Logging application components

The Logging application has the loggers, appenders, and layouts components that you configure.

Loggers

Loggers prepare log statements to be written to console or log file.

Loggers are named entities or keys, such as log4j.logger.maximo.sql. Loggers also form a hierarchy. A logger is defined as an ancestor of another logger. This relationship is true only when the name of the logger is followed by a dot or is a prefix of the descendant logger name. If there are no ancestors between a logger and the descendant logger, a logger becomes the parent of a child logger. For example, log4j.logger.maximo.sql is the parent of log4j.logger.maximo.sql.WORKORDER.

Log levels indicate the type of event that the system logs. You can assign the following levels to Loggers: DEBUG, INFO, WARN, ERROR, and FATAL.

Appenders

Appenders specify the output definitions for loggers. For example, a rolling appender writes log statements to a specified file. Once a size limit for the file is reached, that file is renamed and a new file is created.

Appenders can exist for consoles or files. You can associate one or more loggers with a given appender. Alternatively, you can associate a single logger with multiple appenders.

The product provides the following types of appenders. You cannot delete any of the provided appenders.

Table 1. Appender types
Type Description
Console appender Writes log statements to the application server console.
Rolling appender

Writes log statements to the file specified in the File Name field. Once the file size limit is reached (5 MB by default), the current file is renamed and a new file is created.

For example, if the current file is named maximo.log, then the renamed file is maximo.log.1.

Daily Rolling appender

Writes log statements to the file specified in the File Name field. The file is renamed and a new file is created at a specified rate. This rate depends on the Date Pattern attribute.

For example, if you have configured the Date Pattern of your Daily Rolling Appender to yyyy-MM-dd, when the current file is named maximo_scheduled.log, the renamed file is maximo_scheduled.log.2007-06-18.

Layouts

A layout specifies the output format of the log statement and is always associated with an appender.

For example, a Conversion Pattern such as: %d{dd MMM yyyy HH:mm:ss:SSS} [%-2p] %m%n, results in the following log statement: 2007-05-07 14:07:41,508 [main] INFO MyApp - Entering application;