Cluster Node Log Configuration File

The configuration file for node logging is cluster.log.properties, which is a log4j property file.

Each node in the cluster has a cluster node log configuration file, which resides in the node’s working directory, from which the node is typically started:

Windows: %ESP_HOME%\cluster\nodes\<node-name>\cluster.log.properties

Linux/Solaris: $ESP_HOME/cluster/nodes/<node-name>/cluster.log.properties.

Ensure that the cluster node log configuration file is located in the same directory as that node’s configuration file, <node-name>.xml.

A sample cluster.log.properties file:

com.sybase.esp.cluster.logfile=cluster.log       

log4j.rootLogger=info, Log       

log4j.logger.com.sybase.esp=info   
log4j.logger.com.sybase.esp.cluster.loggers.security.Audit=info, AuditLog   
log4j.logger.com.sybase.esp.cluster.applications=info       

log4j.additivity.com.sybase.esp.cluster.security.Audit=false   
log4j.additivity.com.sybase.esp.cluster.applications=false       

log4j.appender.Log=org.apache.log4j.RollingFileAppender   
log4j.appender.Log.File=${com.sybase.esp.cluster.logfile}   
log4j.appender.Log.MaxFileSize=1MB   
log4j.appender.Log.MaxBackupIndex=5   
log4j.appender.Log.layout=org.apache.log4j.EnhancedPatternLayout   
log4j.appender.Log.layout.ConversionPattern=%d{MMM dd yyyy HH:mm:ss.SSS} %p - %m%n       

log4j.appender.AuditLog=org.apache.log4j.RollingFileAppender   
log4j.appender.AuditLog.File=audit.log   
log4j.appender.AuditLog.MaxFileSize=1MB   
log4j.appender.AuditLog.MaxBackupIndex=5   
log4j.appender.AuditLog.layout=org.apache.log4j.EnhancedPatternLayout   
log4j.appender.AuditLog.layout.ConversionPattern=%d{MMM dd yyyy HH:mm:ss.SSS} %p - %m%n       

.level=INFO   
handlers=com.sybase.esp.cluster.impl.Log4JHandler   
com.sybase.esp.cluster.impl.Log4JHandler.level=FINEST   

In this sample configuration, the com.sybase.esp.cluster.logfile property in the first line specifies that the cluster node log is written to the log file cluster.log, which is located by default in the node working directory, ESP_HOME/cluster/nodes/<node-name>. If you want to write the cluster node log elsewhere, specify a path relative to the node working directory.

Note: You can also set the log file location directly in the appender that writes the log file. In the example above, change the value of log4j.appender.A.File to the desired path and file name, where the path is relative to the node working directory.

cluster.log is configured by default to back up its contents once the file reaches 1MB in size. The MaxBackUpIndex option specifies how many backup files to create.

You can set the rootLogger and logger.com.sybase.esp options to error or info. The info option produces minimum log information. Under normal circumstances, keep the rootLogger option set to the default value info, or the log becomes almost unreadable because of its size. You can use logger.com.sybase.esp to debug a node without using third-party debugging components. Do not modify the log4j.logger.com.sybase.esp.cluster.applications property; the info value is required in this instance.

.com.sybase.esp.cluster.loggers.security.Audit is available as a unique logger which logs significant security audit events, including user login and log out, user authorization and user session expiration. Specifying a special appender for this logger will allow these events to be written to a separate log file. The lines in the sample configuration file that pertain to isolating the security audit events into a separate file are:
log4j.logger.com.sybase.esp.cluster.loggers.security.Audit=info, AuditLog   

log4j.additivity.com.sybase.esp.cluster.security.Audit=false   

log4j.appender.AuditLog=org.apache.log4j.RollingFileAppender   
log4j.appender.AuditLog.File=audit.log   
log4j.appender.AuditLog.MaxFileSize=1MB   
log4j.appender.AuditLog.MaxBackupIndex=5   
log4j.appender.AuditLog.layout=org.apache.log4j.EnhancedPatternLayout   
log4j.appender.AuditLog.layout.ConversionPattern=%d{MMM dd yyyy HH:mm:ss.SSS} %p - %m%n      

Consult log4j documentation for more information on supported properties and configuration instructions.

Related reference
File and Directory Infrastructure