The FMS logging sub system generates log messages at various levels which can be routed to various log files and various external logging systems. The logs provide a trace of messaging transactions, debug statements and errors.
Log4j logging configuration files are located in the log subdirectory of the FMS installation directory.
RPM based distributions - loggging messages are typically sent to /var/log/messages assuming rsyslog has been configured correctly. Typical log4j.properties configuration files are illustrated below.
DEB (debian and ubuntu) based distributions - loggging messages are typically sent to /var/log/syslog assuming rsyslog has been configured correctly. Typical log4j.properties configuration files are illustrated below.
ZIP distributions - Log messages will typically be sent to log files located in the directory that FMS was invoked from.
The following Log4j configuration illustrates using the operating system logging infrastructure.
\ \! Set root category threshhold to INFO and log to Syslog \log4j.rootCategory=INFO, Syslog \! Syslog is set to be a SyslogAppender. \log4j.appender.Syslog=org.apache.log4j.net.SyslogAppender \! Syslog uses PatternLayout. \log4j.appender.Syslog.layout=org.apache.log4j.PatternLayout \! The logging pattern to use, see below. \log4j.appender.Syslog.layout.ConversionPattern=%-5p %m%n \! Set Syslog properties. \log4j.appender.Syslog.SyslogHost=localhost \log4j.appender.Syslog.Facility=INFO \log4j.appender.Syslog.FacilityPrinting=true \ \! If Syslog4j is installed: \! Syslog4j provides client (UDP, TCP, TCP over SSL/TLS, Native Unix syslog, and Unix socket) and server (TCP, TCP over SSL/TLS, and UDP) implementations of the BSD Syslog protocol \! Also see http://www.productivity.org/projects/syslog4j/old/ \! Syslog is set to be a Syslog4jAppender. \! log4j.appender.Syslog=org.productivity.java.syslog4j.impl.log4j.Syslog4jAppender \! log4j.appender.Syslog.Protocol=unix_syslog \! log4j.appender.Syslog.Threshold=INFO \! log4j.appender.Syslog.layout=org.apache.log4j.PatternLayout \! log4j.appender.Syslog.layout.ConversionPattern=%-5p %m%n \ \ |
The following Log4j configuration illustrates using a file based logging infrastructure.
\ \!Set root category threshhold to INFO and log to dest2 \log4j.rootCategory=INFO, dest2 \! Load a Rolling File Appender as our destination \log4j.appender.dest2=org.apache.log4j.RollingFileAppender \! This appender will only log messages with priority equal to or higher than \! the one specified here \log4j.appender.dest2.Threshold=INFO \! Specify the logging file name \log4j.appender.dest2.File=/var/log/fms/fms.log \! Don't overwrite, append \log4j.appender.dest2.Append=true \log4j.appender.dest2.layout=org.apache.log4j.PatternLayout \! The logging pattern to use, see below. \log4j.appender.dest2.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-5p %m%n \! Control the maximum log file size \log4j.appender.dest2.MaxFileSize=512KB \! Keep backup file(s) (backups will be in filename.1, .2 etc.) \log4j.appender.dest2.MaxBackupIndex=10 \ \ |
The log file formate may be customised as follows
\ \<date> <granularity> [<thread>,<classname>:<lineNumber>] \<message> [<internalTrackingID>, <messageTrackingID>] \ \ |
The logging format can be modified by editing the required log4j.properties file.
Table 1. Table of log4j arguments with their descriptions
Argument | Description |
---|---|
%n | A new line follows. |
%m | Log message. <message> <InternalTrackingID> (if applicable) <messageTrackingID> (if applicable) |
%p | Priority. The Logging Level of this message. |
%r | millisecs since program started running. |
%c | name of your category (logger),%c{2} will output the last two components. |
%t | Name of current thread. |
%d | Date and time, also %d{ISO8601}, %d{DATE}, %d{ABSOLUTE}, %d{HH:mm:ss,SSS}, %d{dd MMM yyyy HH:mm:ss,SSS} |
%l | Long. Equivalent to %F%L%C%M |
%F | Java source file name. |
%L | Java source line number. |
%C | Java class name, %C{1} will output the last one component. |
%M | Java method name. |
Table 2. Log Message Components.
Component | Description |
---|---|
<message> | The Log Message |
<InternalTrackingID> | Used by the FMS server to keep record of where messages were sent from so that returned messages will have correct destination. This is required as the server does not only deal with one message at a time. |
<messageTrackingID> | Only applicable in situations where an actual message that was sent to or received by the server(eg: an Invoice) was associated with a particular log message. |
Table 3. Log Granularity
Logging Level | Semantic Level |
---|---|
TRACE | Log TRACE messages and include all messages as below. |
DEBUG | Log DEBUG messages and includes all messages as below. |
INFO | Log INFO messages and include all messages as below. |
WARN | Log WARN messages and include all messages as below. |
ERROR | Log ERROR messages and include all messages as below. |
FATAL | Quiet. Only logs fatal errors. |
<<< Previous | Home | Next >>> |
ebMS Reliable Messaging | Extending Schema Content Support |