Customizing log4j configuration

The application uses the log4j utility for logging. The log4j utility writes trace and
debug information to a log file. You can modify the logging parameters in the log4j configuration
file to control the location and level of the log files.

You can configure the logger to send different categories of messages to different destinations.
Categories are organized hierarchically, which permits inheritance. Each category can be configured
with a priority indicating a severity level. If a category is not configured with a priority, it
inherits the priority of its closest ancestor with an assigned priority.

You can customize the log4j configuration file in one of the following ways:

  • 17.4Differential extensibility of log4j configuration

    With differential
    extensibility, you need to only update the custom log4jconfig.xml file and the
    changes are overlaid on the application-provided log4jconfig.xml file, unlike
    Override Extensibility, where you need to create a copy of the application-provided
    log4jconfig.xml and customize it. Differential extensibility provides
    flexibility during upgrades.

  • Override extensibility of log4j configuration

    With override extensibility, you can
    customize the log4j configuration by creating a copy of the application-provided
    log4jconfig.xml file and extending it.

Note: IBM recommends differential extensibility method for customizing the log4j
configuration.

Join The Discussion

Your email address will not be published. Required fields are marked *