Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

Important: THIS ARTICLE IS WORK IN PROGRESS

Contact our sales department should you find parts to be unclear

JADE can write a separate log file for each transfer , both it carries out.
It can do this when the transfer is started from the console or the chrontaband when it is started from the chrontab. There are two stages to doing this:

  • specifying the global log file name,
  • specifying the log file name for each transfer.

1. To specify the global log file name

The log file to be used for a particular transfer is defined in the log4j.properties file.

A "rollingFileAppender" is used to configure the "global" log, which is not transfer-specific.

The log4j.properties file can be located in the same folder as the profile.ini file. The parameter defining the location of log4j does not have to be explicitly set in the profil.

A typical log4j.properties file looks would look like:

Code Block
languagehtml/xml
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%p %t %c - %m%n
log4j.rootCategory# $Id: log4j.properties 17657 2012-07-23 12:55:04Z kb $

log4j.rootLogger=debug, stdout
log4j.logger.JadeReportLog=info, JadeReportLog, fileJadeReportLogHTML

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t]%t %-5p %-14d\{hh:mm:ss,SSS\} %p (%F:%L) ::%M -%m %m%n%n

# Configuration of the log filefor JadeReportLog
log4j.appender.fileJadeReportLog=org.apache.log4j.RollingFileAppender
log4j.appender.fileJadeReportLog.File=/var/opt/sosftp/log/sosdex$\{java.io.tmpdir\}/Jade-client.log

log4j.appender.fileJadeReportLog.MaxFileSize=10000KB
5000KB
# Keep a backup copy 
log4j.appender.fileJadeReportLog.MaxBackupIndex=10
30
log4j.appender.fileJadeReportLog.layout=org.apache.log4j.PatternLayout
log4j.appender.fileJadeReportLog.layout.ConversionPattern=%p %t %c - %m%n%-21d\{hh:mm:ss,SSS\}%m %n

Note that:

  • the default value for stdout is set by the operating system and
  • the default location for the jade-log is:
    • /var/opt/sosftp/log/sosdex.log

...

  • this means that when starting chron:
    • use cd to navigate to the home directory
    • start jade.sh
    • start runner-script.sh, which switches the working directory to the bin directory
    • the name of the log4j file can then be set with a parameter.

A typical profile would look like:

...

2. To specify the log file name for each transfer

XI

die The log4.jproperties ist is universal. Der Name, den sie als The name specified with the log_filename angeben, wird, mit der extension .html erweitert, auch für log4j verwendet. Der Trick: die Definitionen in der property-datei werden dynamisch verändert. Es entstehen dann zwei Dateien: einmal die Datei mit dem Namen der in log_filename angegeben ist und dann die html-Datei mit einer Zusammenfassung des Transfers. Die html-Datei wird jedesmal überschrieben, die log-datei ist ein rollierendes Log-File.parameter is extended using the extension ".html" and used for log4j. The trick here is that the definitions in the property file are dynamically modified. This results in two files:

  • the file with the name specified in the log_filename and
  • the HTML file with a summary of the transfer.
    The HTML file will be overwritten with every transfer, the log_filename file is a rolling log file.

<!--

Code Block
languagehtml/xml
[Transfer1]
log4j_Property_FileName = /opt/sosftp/sosdex_client.1.3.12.2207/profile/log4j.properties
log_filename = /var/opt/sosftp/log/Transfer1.log

[Transfer2]
log4j_Property_FileName = /opt/sosftp/sosdex_client.1.3.12.2207/profile/log4j.properties
log_filename = /var/opt/sosftp/log/Transfer2.log

-->
<!--
Wenn ich die Transfers laufen lasse, sollte mir zum einen das in der log4j definierte "globale" sodex.log geschrieben werden, was auch der Fall ist, sowie das transferspezifische Transfer1.log. Dieses Log vermisse ich allerdings im dazugehoerenden Logverzeichnis (sad).

XII

Sie machen da nichts falsch. Es liegt an der log4j.properties Datei.

Meine sieht so aus:

...

-->

The complete log4j.properties file would then look like:

Code Block
languagehtml/xml

# $Id: log4j.properties 17657 2012-07-23 12:55:04Z kb $

...



log4j.

...

rootLogger=debug, stdout

...


log4j.logger.

...

JadeReportLog=info, JadeReportLog, JadeReportLogHTML

...



log4j.appender.

...

stdout=org.apache.log4j.ConsoleAppender

...


log4j.appender.stdout.

...

layout=org.apache.log4j.PatternLayout

...


log4j.appender.stdout.layout.

...

ConversionPattern=%t %-5p %-14d\{hh:mm:ss,SSS\} %p (%F:%L) ::%M %m %n

...



# Configuration as HTML

...


log4j.appender.

...

JadeReportLogHTML=org.apache.log4j.FileAppender

...


log4j.appender.JadeReportLogHTML.

...

layout=org.apache.log4j.HTMLLayout

...


log4j.appender.JadeReportLogHTML.

...

File=$\{java.io.tmpdir\}/Jade-client.html

...


log4j.appender.JadeReportLogHTML.

...

Append=false

...


log4j.appender.JadeReportLogHTML.layout.

...

Title=JADE - JobScheduler Advanced Data Exchange

...



# Configuration for JadeReportLog

...


log4j.appender.

...

JadeReportLog=org.apache.log4j.RollingFileAppender

...


log4j.appender.JadeReportLog.

...

File=$\{java.io.tmpdir\}/Jade-client.log

...


log4j.appender.JadeReportLog.

...

MaxFileSize=5000KB
# Keep a backup copy 
log4j.appender.JadeReportLog.

...

MaxBackupIndex=30
log4j.appender.JadeReportLog.

...

layout=org.apache.log4j.PatternLayout

...


log4j.appender.JadeReportLog.layout.

...

ConversionPattern=%-21d\{hh:mm:ss,SSS\}%m

...

 %n

The transfer-specific log file is configured in the HTML appender shown in the listing above. Der Name der Datei ist in der Datei "nur" ein Platzhalter. JADE macht daraus The file name in the file is "only" a placeholder. JADE modifies this to "log_filename".html

In der jetzigen JADE-Version wird da noch ein standard-Layout von log4j verwendet, was imho nicht so nett ist. Ich habe bereits eine modifizierte Version im Einsatz, die auch z.B. Zeilenumbrüche beherschtNote that in the current (1.5.4014) JADE version a standard and relatively simple log4j layout is used. A modified layout, which includes line breaks, is being tested.