The aim of this blog is to provide you a way to configure the JMS Logs in order to align all applications logging with date information, log rotation and retention. Some changes have to be done on the jboss container as well as on the log4j utility for each deployed JMS applications (acs.ear, serverapps.ear and bpm.ear).
General configuration
First, go to the JMS configuration at $DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/configuration/
The jboss version may vary depending on your Content Server version.
Do a backup of the standalone file like follow:
cp standalone.xml standalone.xml_$(date +%Y%m%d).log
Then edit the file standalone.xml by replacing each pattern-formatter with the following configuration:
<pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %s%E%n"/>
Note that you can change this setting which will change the way the log file will look like, but try to be consistent with other environments and components.
Now go to application deployments: $DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/deployments
Once again, depending your Content Server version you could have to go into deploy instead of deployments.
For ServerApps.ear
Backup the current log4j.properties file:
cp ./ServerApps.ear/APP-INF/classes/log4j.properties ./ServerApps.ear/APP-INF/classes/log4j.properties_$(date +%Y%m%d).log
Then edit ./ServerApps.ear/APP-INF/classes/log4j.properties and set it like this:
log4j.rootCategory=WARN, A1, F1 log4j.category.MUTE=OFF log4j.additivity.tracing=false log4j.category.tracing=DEBUG, FILE_TRACE #------------------- CONSOLE -------------------------- log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.threshold=ERROR log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n #------------------- FILE -------------------------- log4j.appender.F1=org.apache.log4j.RollingFileAppender log4j.appender.F1.File=$DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/logs/ServerApps.log log4j.appender.F1.MaxFileSize=10MB log4j.appender.F1.layout=org.apache.log4j.PatternLayout log4j.appender.F1.MaxBackupIndex=10 log4j.appender.F1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n #------------------- ACS -------------------------- log4j.category.acs=WARN, ACS_LOG log4j.appender.ACS_LOG=org.apache.log4j.RollingFileAppender log4j.appender.ACS_LOG.File=$DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/logs/AcsServer.log log4j.appender.ACS_LOG.MaxFileSize=100KB log4j.appender.ACS_LOG.layout=org.apache.log4j.PatternLayout log4j.appender.ACS_LOG.MaxBackupIndex=10 log4j.appender.ACS_LOG.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n #------------------- FILE_TRACE -------------------------- log4j.appender.FILE_TRACE=org.apache.log4j.RollingFileAppender log4j.appender.FILE_TRACE.File=$DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/logs/ServerApps_trace.log log4j.appender.FILE_TRACE.MaxFileSize=100MB log4j.appender.FILE_TRACE.layout=org.apache.log4j.PatternLayout log4j.appender.FILE_TRACE.MaxBackupIndex=10 log4j.appender.FILE_TRACE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n
We changed the conversion pattern in order to add more info when logging. For example, here we added “z” in order to show the TimeZone. With such configuration it is easier to compare several logs which can be generated from different servers in different time zones.
We also added the MaxFileSize and MaxBackupIndex in order to manage the retention. In the code above the logs will be generated in maximum 10 files of 100MB, hence it will never exceed 1GB on the file system. The drawback is that if you have a lot of logs generated it will grow fast and the older files will be replaced by the new ones.
For acs.log
You can do the same as before, first backup the configuration file:
cp ./acs.ear/lib/configs.jar/log4j.properties ./acs.ear/lib/configs.jar/log4j.properties_$(date +%Y%m%d).log
Then edit ./acs.ear/lib/configs.jar/log4j.properties and set it like this:
log4j.rootCategory=WARN, A1, F1 log4j.category.MUTE=OFF log4j.additivity.tracing=false log4j.category.tracing=DEBUG, FILE_TRACE #------------------- CONSOLE -------------------------- log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.threshold=ERROR log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n #------------------- FILE -------------------------- log4j.appender.F1=org.apache.log4j.RollingFileAppender log4j.appender.F1.File=$DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/logs/acs.log log4j.appender.F1.MaxFileSize=10MB log4j.appender.F1.layout=org.apache.log4j.PatternLayout log4j.appender.F1.MaxBackupIndex=10 log4j.appender.F1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n #------------------- ACS -------------------------- log4j.category.acs=WARN, ACS_LOG log4j.appender.ACS_LOG=org.apache.log4j.RollingFileAppender log4j.appender.ACS_LOG.File=$DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/logs/AcsServer.log log4j.appender.ACS_LOG.MaxFileSize=100KB log4j.appender.ACS_LOG.layout=org.apache.log4j.PatternLayout log4j.appender.ACS_LOG.MaxBackupIndex=10 log4j.appender.ACS_LOG.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n #------------------- FILE_TRACE -------------------------- log4j.appender.FILE_TRACE=org.apache.log4j.RollingFileAppender log4j.appender.FILE_TRACE.File=$DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/logs/acs_trace.log log4j.appender.FILE_TRACE.MaxFileSize=100MB log4j.appender.FILE_TRACE.layout=org.apache.log4j.PatternLayout log4j.appender.FILE_TRACE.MaxBackupIndex=10 log4j.appender.FILE_TRACE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n #-------------------- ATMOS LOGGING --------------------- log4j.logger.com.documentum.content.store.plugin.atmos=DEBUG,ACS_LOG log4j.logger.com.emc.esu=WARN,ACS_LOG
For bpm.ear
You can do the same as before, first backup the configuration file:
cp ./bpm.ear/APP-INF/classes/log4j.properties ./bpm.ear/APP-INF/classes/log4j.properties_$(date +%Y%m%d).log
Then edit ./bpm.ear/APP-INF/classes/log4j.properties and set it like this:
log4j.rootCategory=WARN, A1, F1 log4j.category.MUTE=OFF log4j.additivity.tracing=false log4j.category.tracing=DEBUG, FILE_TRACE #------------------- CONSOLE -------------------------- log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.threshold=ERROR log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n #------------------- FILE -------------------------- log4j.appender.F1=org.apache.log4j.RollingFileAppender log4j.appender.F1.File=$DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/logs/bpm.log log4j.appender.F1.MaxFileSize=10MB log4j.appender.F1.layout=org.apache.log4j.PatternLayout log4j.appender.F1.MaxBackupIndex=10 log4j.appender.F1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n #------------------- BPM -------------------------- log4j.logger.com.documentum.bpm=WARN, bpmappender log4j.logger.com.documentum.bps=WARN, bpmappender log4j.additivity.com.documentum.bpm=false log4j.additivity.com.documentum.bps=false log4j.appender.bpmappender=org.apache.log4j.RollingFileAppender log4j.appender.bpmappender.File=$DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/logs/bpm-runtime.log log4j.appender.bpmappender.MaxFileSize=1MB log4j.appender.bpmappender.layout=org.apache.log4j.PatternLayout log4j.appender.bpmappender.MaxBackupIndex=10 log4j.appender.bpmappender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n #------------------- FILE_TRACE -------------------------- log4j.appender.FILE_TRACE=org.apache.log4j.RollingFileAppender log4j.appender.FILE_TRACE.File=$DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/logs/bpm_trace.log log4j.appender.FILE_TRACE.MaxFileSize=100MB log4j.appender.FILE_TRACE.layout=org.apache.log4j.PatternLayout log4j.appender.FILE_TRACE.MaxBackupIndex=10 log4j.appender.FILE_TRACE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS z} %-5p [%c] (%t) %m%n
When everything is setup you can restart the JMS and verify that all logs are properly written in $DOCUMENTUM_SHARED/jboss7.1.1/server/DctmServer_MethodServer/logs
Now you have your JMS log system setup consistently.