Rhapsody ships with a default log4j.properties file that initializes several loggers and a number of appenders to these loggers. As all of this logging information is defined in the log4j.properties file, it can be changed dynamically by simply modifying the properties file and saving it.

Log4j

Rhapsody uses the log4j framework for its logging capabilities. Refer to Log4j for details.

Root Logger

The Root Logger defines the main Rhapsody logger. It is special in that it always exists and defines the default settings for logging of all components within the Rhapsody application. The logging system is structured in a hierarchical manner such that certain components can be logged at a different level.

The appenders generally override this logging level and use their own if their logging level is higher than the root level. For example, if the root logger is set at the Info level and a logger for a child component is set at the Warn level, then messages at the Warn level and higher appears in the log appender associated with the logger for the child component as well as in the root logger. However, if the child component is set at the Trace level, then that child component is logged at the Trace level in both the child logger and root logger.

By default, it is defined in the log4j.properties file as follows:

# The default logging setting. Logs to the Normal appender.
log4j.rootLogger=INFO,NormalAppender

The first parameter to this property is the default logging level, which in this case is INFO. Generally the INFO level should be used for Rhapsody engines in production situations. If additional debugging information is required, you can set this to DEBUG.

Other parameters are the various log4j appenders that are configured by default. These are described in the following sections.

Main Rhapsody Log

The main Rhapsody log file is created in the <Rhapsody>/log<s> folder and is called Rhapsody.log<log.txt>. This log file is attached to the main Rhapsody logger, and thus has all logging events available to it. It is configured as follows:

# Normal Appender
log4j.appender.NormalAppender=org.apache.log4j.RollingFileAppender
log4j.appender.NormalAppender.File=log/log.txt
log4j.appender.NormalAppender.MaxBackupIndex=9
log4j.appender.NormalAppender.MaxFileSize=5MB
log4j.appender.NormalAppender.encoding=UTF-8
log4j.appender.NormalAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.NormalAppender.layout.ConversionPattern=%d{DATE} [%-5p] {%t} (%c) %m%n

This creates an appender of type RollingFileAppender which writes the logging events to disk, and automatically rolls over to a new log file when the current log file reaches the maximum file size. Older log files have a sequential number appended to the filename, making them easy to find.

Console Appender

Rhapsody includes a Console Appender to output the main Rhapsody logger to the console (standard output - stdout). This allows current activity to be easily monitored when running Rhapsody from the command line. However, Rhapsody usually runs as a service and therefore is not able to write to the console. When this is the case, anything logged to the console will be ignored.

# Console Appender
log4j.appender.ConsoleAppender=org.apache.log4j.ConsoleAppender
log4j.appender.ConsoleAppender.encoding=UTF-8
log4j.appender.ConsoleAppender.Target=System.out
log4j.appender.ConsoleAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.ConsoleAppender.layout.ConversionPattern=%d{DATE} | %-11r [%-5p] {%t} (%c) %m%n

By default, this appender operates at the INFO level. It can be useful to use the Console Appender when manually running the wrapper.exe instead of starting Rhapsody as a service.

The Console Appender is disabled by default. To enable console logging, append the Console Appender to the Root Logger:

log4j.rootLogger=INFO,NormalAppender,ConsoleAppender

Windows NT Appender (Windows® Only)

The Windows NT Appender enables you to log errors to the Windows® NT event log.

This appender can only be installed and used on a Windows® system and requires the NTEventLogAppender.dll in a directory that is on the PATH of the Windows system. This is installed by Rhapsody during the installation process. (Otherwise, you will get a java.lang.UnsatisfiedLinkError.)

# Windows NT Event Log Appender
#log4j.appender.NT=org.apache.log4j.nt.NTEventLogAppender
#log4j.appender.NT.layout=org.apache.log4j.PatternLayout
#log4j.appender.NT.layout.ConversionPattern=%d{DATE} %-5p [%t] (%c) %m%n
#log4j.appender.NT.Threshold=ERROR
#log4j.appender.NT.Source=Rhapsody 

The Windows NT Appender is disabled by default. Refer to Logging to the Windows Event Log for details on enabling this feature.

Communication Point and Route Loggers

These loggers provide informational logging about communication points and routes.

# Internal loggers
log4j.logger.CommunicationPoint=INFO
log4j.logger.Route=INFO

Additionally, loggers can be enabled for specific communication points or routes by adding the object ID (which is displayed in the Management Console) to the logger definition, for example:

log4j.logger.CommunicationPoint.5=INFO

Rhapsody IDE Command and Event Log

The Rhapsody IDE Command and Event logs enable you to activate debug logging to handle commands sent between clients and the server.

All the information contained within the command audit trail log is actually available from the main Rhapsody log. However, extracting it into a seperate log file is useful for two reasons:

  • It makes viewing the commands much simpler as they are all available in one place, rather than scattered among all the other Rhapsody log statements.
  • Most of the logging statements in the Rhapsody IDE command and event log are reported at the debug level, but the main Rhapsody log normally operates at the info level. Consequently this would mean that all of these events would be lost if only sent to the main log file.
# Rhapsody IDE Command and Event Log
#log4j.logger.com.orchestral.rhapsody.admin=DEBUG,IdeAppender
#log4j.logger.com.orchestral.rhapsody.event=DEBUG,IdeAppender
#
#log4j.appender.IdeAppender=org.apache.log4j.RollingFileAppender
#log4j.appender.IdeAppender.File=log/ide-log.txt
#log4j.appender.IdeAppender.MaxBackupIndex=9
#log4j.appender.IdeAppender.MaxFileSize=5MB
#log4j.appender.IdeAppender.encoding=UTF-8
#log4j.appender.IdeAppender.layout=org.apache.log4j.PatternLayout
#log4j.appender.IdeAppender.layout.ConversionPattern=%d{DATE} [%-5p] {%t} (%c) %m%n

Third-party Library Loggers

Any warning errors reported by third-party libraries are logged to the WARN level.

To disable logging done by third party libraries:

  • Add a hash (#) symbol to the start of the line you want to disable.

    # Disable logging done by 3rd party libraries
    log4j.logger.org.apache.xml.security=WARN
    log4j.logger.org.apache.commons=WARN
    log4j.logger.org.apache.struts=WARN
    log4j.logger.org.mortbay=WARN
    log4j.logger.org.quartz=WARN
    log4j.logger.org.jfree=WARN
    log4j.logger.org.directwebremoting=WARN
    log4j.logger.org.apache.axis2.engine.AxisEngine=FATAL
    log4j.logger.org.apache.axis2.transport.http.HTTPSender=FATAL
    log4j.logger.org.apache.commons.httpclient.HttpMethodDirector=ERROR
    log4j.logger.com.enterprisedt=WARN
    log4j.logger.com.enterprisedt.AsyncService=OFF

We do not recommend disabling these loggers.

Archive Cleanup Logging

Diagnostic information is captured during the Archive Cleanup process. This information is logged to a separate log file and does not propagate up to the Root Logger. The default level is DEBUG which can produce a lot of output which is why it is kept separate from the main Rhapsody log. The Archive Cleanup log file is created in the <Rhapsody>/log/archiveCleanupLog folder and is called cleanup_log.txt.

# Archive Cleanup
log4j.logger.ArchiveCleanup=DEBUG,ArchiveCleanupAppender
log4j.additivity.ArchiveCleanup=false
log4j.appender.ArchiveCleanupAppender=org.apache.log4j.RollingFileAppender
log4j.appender.ArchiveCleanupAppender.File=log/archiveCleanupLog/cleanup_log.txt
log4j.appender.ArchiveCleanupAppender.MaxBackupIndex=9
log4j.appender.ArchiveCleanupAppender.MaxFileSize=5MB
log4j.appender.ArchiveCleanupAppender.encoding=UTF-8
log4j.appender.ArchiveCleanupAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.ArchiveCleanupAppender.layout.ConversionPattern=%d{DATE} [%-5p] {%t} (%c) %m%n

System Appender

There is a separate System Appender for logging messages for core system components. This logs to a separate log file so that these important messages are not obscured by other logging that may occur in the main Rhapsody log. The System log file is created in the <Rhapsody>/log folder and is called system.txt.

# System Appender
log4j.appender.SystemAppender=org.apache.log4j.RollingFileAppender
log4j.appender.SystemAppender.File=log/system.txt
log4j.appender.SystemAppender.MaxBackupIndex=9
log4j.appender.SystemAppender.MaxFileSize=5MB
log4j.appender.SystemAppender.Threshold=WARN
log4j.appender.SystemAppender.encoding=UTF-8
log4j.appender.SystemAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.SystemAppender.layout.ConversionPattern=%d{DATE} [%-5p] {%t} (%c) %m%n

The following is a list of the loggers for core system components which will be logged to the System Appender:

# Loggers to include in system appender
log4j.logger.com.orchestral.common.file=,SystemAppender
log4j.logger.com.orchestral.rhapsody.backup=,SystemAppender
log4j.logger.com.orchestral.rhapsody.blobstore=,SystemAppender
log4j.logger.com.orchestral.rhapsody.btree=,SystemAppender
log4j.logger.com.orchestral.rhapsody.cleanup=,SystemAppender
log4j.logger.com.orchestral.rhapsody.execution=,SystemAppender
log4j.logger.com.orchestral.rhapsody.index=,SystemAppender
log4j.logger.com.orchestral.rhapsody.initialisation=,SystemAppender
log4j.logger.com.orchestral.rhapsody.message=,SystemAppender
log4j.logger.com.orchestral.rhapsody.query=,SystemAppender
log4j.logger.com.orchestral.rhapsody.queue=,SystemAppender
log4j.logger.com.orchestral.rhapsody.security=,SystemAppender
log4j.logger.com.orchestral.rhapsody.statistics=,SystemAppender
log4j.logger.com.orchestral.rhapsody.store=,SystemAppender
log4j.logger.com.orchestral.rhapsody.taskscheduler=,SystemAppender
log4j.logger.com.orchestral.rhapsody.transaction=,SystemAppender
log4j.logger.com.orchestral.rhapsody.usermanagement=,SystemAppender
log4j.logger.com.orchestral.rhapsody.validate=,SystemAppender

These will log at the same level that is configured for the Root Logger (INFO by default).

Audit Logger

The Audit Logger enables you to separate out audit logging from your main log file.

All the information contained within the audit log is available in the main Rhapsody log. However, extracting the audit logs into a separate log file makes analyzing them much easier.

To enable audit logging, uncomment the following properties:

# Audit Logger
#log4j.logger.User=INFO,AuditAppender
#log4j.additivity.User=false

# Audit Log Appender
#log4j.appender.AuditAppender=org.apache.log4j.RollingFileAppender
#log4j.appender.AuditAppender.File=log/audit/audit.txt
#log4j.appender.AuditAppender.MaxBackupIndex=9
#log4j.appender.AuditAppender.MaxFileSize=5MB
#log4j.appender.AuditAppender.encoding=UTF-8
#log4j.appender.AuditAppender.layout=org.apache.log4j.PatternLayout
#log4j.appender.AuditAppender.layout.ConversionPattern=%d{DATE} [%-5p] {%t} (%c) %m%n