Configuring Apache log4j log files

You can configure the batch processor to use Apache log4j log files, and also configure the level of detail recorded in the logs.

About this task

Log4j log files have the following predefined logging levels:

  • ALL – log all messages.
  • DEBUG – log all debug level messages and above.
  • INFO – log all informational level messages and above.
  • WARN – log all warning level messages and above.
  • ERROR – log all error level messages and above.
  • FATAL – log only fatal error messages.
  • OFF – disable logging.

To configure Apache log4j log files:

Procedure

  1. To set the logging type to Apache log4j:
    1. Edit the DWLLog.properties file.
    2. Change the value of the LoggerFactory property to com.dwl.base.logging.DWLLog4jLoggerFactory:
      LoggerFactory=com.dwl.base.logging.DWLLog4jLoggerFactory
    Note: By default, log4j is defined as the logging type.
  2. To configure the detail level of the messages that are displayed on the console during batch processing:
    1. Edit the log4j.properties file.
    2. Depending on the logging level you wish to set, change the value of the log4j.appender.stdout.Threshold property to one of the predefined logging levels.
      log4j.appender.stdout=org.apache.log4j.ConsoleAppender
      log4j.appender.stdout.Threshold=WARN
      Tip: If you wish to turn off console output so that the user can have a clear console, change the value of log4j.appender.stdout.Threshold to OFF.
  3. To configure the detail level of the messages that are logged in the batch processing log files:
    1. Edit the log4j.properties file.
    2. Depending on the logging level you wish to set for each log file type, change the value of the following logging level properties to one of the predefined logging levels:
      • Batch log:
        log4j.appender.file.Threshold=DEBUG
        log4j.appender.file.File=$home/logs/Batch.log
        Note: The Batch log records all batch output. All messages written to all log files are also written to this log file.
        Tip: Change the logging level of the Batch log to ERROR so that it only tracks error messages.
      • Activity log:
        log4j.logger.BulkProcessing.Activity=INFO, bulkProcessingActivity