Log4j1 configuration XML file

Understand properties in the log4j1 XML file.

The following table describes the properties in the log4j1 XML file.

Property Description
In the log4j1 configuration XML File
priority subelement of the root element Specify the level of logging desired. The logging level defined in the log4jconfig.xml file is restrictive. You can control the logging level criteria either through the System Management Console or by calling the modifyTrace API.

The following are valid values for logging levels:

  • ERRORDTL
  • ERROR
  • WARN
  • INFO
  • TIMER
  • SQLDEBUG
  • DEBUG
  • VERBOSE
appender subelement At the root level, this attribute specifies the associated name and class attribute. Choose a valid log4j1 appender class.

Each subelement can also specify the layout of the message through the layout subelement and can filter for levels through the filter subelement.

Instead of hardcoding the absolute path for the log file under the appender you plan to use, IBM® recommends that customers should also use a ${LOG_DIRECTORY} parameter in the log4jconfig.xml file and invoke the JVM with a -DLOG_DIRECTORY=application_log_directory/logFileName option.

param subelement of the appender element This attribute specifies the associated name and value attribute. You can set the following variables using the param attribute:
  • maxLogSize - Specify the maximum number of write operations to be made to a log file (that is, this is not the memory size limit of the log file. The size of log file will depend on the size of each write operation.) By default, the value of this variable is set to 100000.
  • rotateLogs - Determines whether the log files should be split or not. If the value of this variable is set to false, the log files will not be split, and logger will keep writing in the same file. By default, the value of this variable is set to true.