Configure logging properties for an application

The logger.properties file allows you to set logger attributes for specific loggers. The properties file is loaded the first time the method Logger.getLogger(loggername) is called within an application.

When an application calls the Logger.getLogger method for the first time, all the available logger properties files are loaded. Applications can provide logger.properties files in:

  • the META-INF directory of the JAR file for the application

  • directories included in the class path of application module

  • directories included in the application class path

The properties file contains two categories of parameters - Logger control and Logger data:

  • Logger control information

    • minimum localization level - minimum LogRecord level for which localization will be attempted

    • group - logical group that this component belongs to

    • eventfactory - The Common Base Event template file to use with the event factory. Note that the naming convention for this template is the fully qualified component name, with a file extension of “.event.xml”. For example, a template that applies to package com.ibm.compXYZ would be called com.ibm.compXYZ.event.xml

  • Logger data information

    • product name

    • organization name

    • component name

    • extensions – additional properties

 

Sample logger.properties file

In the following

sample, event factory com.ibm.xyz.MyEventFactory will be used by any loggers in the com.ibm.websphere.abc package or any sub-packages which do not override this value in their own configuration file

com.ibm.websphere.abc.eventfactory=com.ibm.xyz.MyEventFactory