Setting up log4j logging for Omni-Configurator
Omni-Configurator uses the log4j utility to provide the logging functionality. You can modify the logging parameters in the log4j configuration file to control the location and level of the log files.
- Create the log4j.properties file in the <config_repo_home>/omniconfigurator/<property_repository> directory. For example, <config_repo_home>/omniconfigurator/properties.
- Copy and paste the following content into the log4j.properties
file:
# Root logger option log4j.rootLogger=INFO, file # Redirect log messages to console log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1} - %m%n # Redirect log messages to a log file, support file rolling. log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=/opt/IBM/configurator_logs/configurator.out log4j.appender.file.MaxFileSize=5MB log4j.appender.file.MaxBackupIndex=10 log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1} - %m%n log4j.appender.TIMER=org.apache.log4j.RollingFileAppender log4j.appender.TIMER.threshold=TIMER#com.ibm.configurator.logger.TimerLevel log4j.appender.TIMER.File=/opt/IBM/configurator_logs/configurator.out log4j.appender.TIMER.MaxFileSize=5MB log4j.appender.TIMER.MaxBackupIndex=10 log4j.appender.TIMER.layout=org.apache.log4j.PatternLayout log4j.appender.TIMER.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1} - %m%n
Note: Before setting up the logging parameters, ensure that you understand the log4j utility. For
detailed information about this utility, refer to the Apache website.