IBM Support

Logging in Maximo

Troubleshooting


Problem

The purpose of Maximo Logging is to provide customers with meaningful and easy configurable logging to resolve problems quickly without changing released code, using the open source logging API log4j.

Resolving The Problem

Overview

In Maximo 6.2, 7.1, 7.5 and 7.6, administrators can log messages from a simple configuration file and see the log messages output in various different formats. From these log files it should be possible to figure out the process flow from the log messages to debug the problem. This document explains the logging with both versions of Maximo.

Maximo has incorporated logging functionality based on an open source logging API called Log4j. The Log4j API was developed by Apache Software Foundation as part of the Apache Jakarta Project. The purpose of Maximo logging functionality and its usage is to help resolve problems quickly without changing released code.

Maximo Logging Basics

Logging is performed in Maximo using a logger object. Loggers define a hierarchy and provide the run-time control to print statements or not. Loggers are named entities. Logger names are case-sensitive and they follow the hierarchical naming rule.

Specifying Log Information

Maximo 6.2.x

Maximo logging information is specified in <maximo_root>\applications\maximo\properties\logging.properties file for the Maximo application. This file is a standard Log4j properties file with Maximo-specific logging details, and should be edited to change logging behavior, e.g., enabling or disabling loggers and directing the output to different destinations.

After making any changes, you will need to rebuild and redeploy the EAR files in order for these changes to take effect.

Maximo 7.1.x, Maximo 7.5.x and Maximo 7.6.x

In Maximo 7.1.x, 7.5.x and 7.6.x, you make changes in the Logging application, located by going to System Configuration > Platform Configuration . You must be logged in as a user with administrative privileges to modify the Logging and apply and save changes.

In Maximo 7.1.x, 7.5.x and 7.6.x, you can change logging properties without restarting Maximo, and they will take effect immediately upon selecting Apply Settings from the Select Action Menu.

See Creating a Maximo Log File to Troubleshoot Maximo 7 Issues for details on setting up logging in Maximo 7.x.

Log Levels in Detail

A logger is said to be an ancestor of another logger if its name followed by a dot is a prefix of the descendant logger name. A logger is said to be a parent of a child logger if there are no ancestors between it and the descendant logger. Loggers are assigned levels.

A log statement is printed depending on its level and its logger. The following log levels supported for any logger are FATAL, ERROR, WARN, INFO, DEBUG.

A level of OFF can be used to turn off log messages to a specific logger.

The log levels are also inherited. If a given logger is not assigned a level, then it inherits the one from its closest ancestor with an assigned level.

The inherited level for a given logger C, is equal to the first non-null level in the logger hierarchy, starting at C and proceeding upwards in the hierarchy towards the root logger.

Appenders

An Appender is an output destination (usually a file, or sometimes a location, such as a console window) where log information can be written to. Logging requests can be sent to more than one output destination (appender, file).

Usage

FATAL - A message logged at FATAL level indicates that the error is very severe and will cause the application not to function at all. This level is used only by the Maximo application framework code to indicate that the Maximo application failed.

ERROR - A message logged at ERROR level indicates that the application would continue to run, but a specific functionality that's processed by the current thread failed and would continue to fail until the processing information is altered.

WARN - A message logged at WARN level indicates that the application would continue to run, but a specific functionality that's processed by the current thread may be operating on some data that might not be appropriate.

INFO - A message logged at INFO level indicates a general message that highlights the progress of the specific functionality that's processed by the current thread.

DEBUG - A message logged at DEBUG level indicates a general message that provides fine-grained information about the progress of the specific functionality that is being processed by the current thread.

NOTE: The DEBUG level is used to log messages that are useful for customers, support and development to diagnose problems in detail, but it is extremely verbose and should be used sparingly.

Maximo loggers are organized based on Maximo functional hierarchy. Application framework code uses the following fixed loggers to output framework related messages that are common to all.

Hierarchy

A logging request is enabled if its level is higher than or equal to the level of its logger. Otherwise, the request is disabled. The levels are in the following order from highest to lowest:


FATAL > ERROR > WARN > INFO > DEBUG

This means that if a logger is enabled for INFO level, it would accept FATAL, ERROR, WARN level messages and discards DEBUG level messages.

Maximo Root Loggers

Maximo 6.2.x, Maximo 7.1.x, 7.5.x and 7.6.x

LoggerFunction
log4j.maximoRoot of all Maximo loggers
log4j.maximo.applicationRoot of the Maximo application specific loggers. Enable this logger to see all application logging
log4j.maximo.crontaskRoot of all Maximo CRON task loggers. Enable this logger to see all CRON task activity
log4j.maximo.datadictionaryRoot of all Maximo data dictionary loggers. Enable this logger to see data dictionary messages
log4j.maximo.eventRoot of all Maximo event loggers. Enable this logger to see all Maximo events
log4j.maximo.mailRoot of all Maximo mail message loggers. Enable this logger to see all e-mail messages sent from Maximo
log4j.maximo.serviceRoot of all Maximo service loggers. Enable this logger to see all business object service messages
log4j.maximo.sqlRoot of all Maximo database SQL loggers. Enable this logger to see all SQL statements
By default, all Maximo loggers are set to output only error messages, except for the Maximo root logger, in the initially-installed log configuration file. The Maximo root logger is, by default, set to output informational messages, which you normally see when the Maximo application is started. Since loggers are organized in hierarchical order, enabling a log level for a logger would automatically enable the same level for all descendant loggers, unless a descendant logger overrides the log level.

All the loggers that are derived from the fixed loggers are called dynamic loggers. The name of the dynamic logger is constructed based on the context where the code is currently executed. For example, every CRON task may have a logger associated with it, which can be retrieved from the CRON task based on the CRON task name. The logger would be created based on maximo.crontask.<CRON task name> name.

For CRON tasks with multiple instances, you add the name of the instance to the logger: maximo.crontask.<CRON task name>.<CRON Task instance name>.

Following is an example of some of the dynamic loggers that can be configured in the Maximo configuration file.

# ~~ Business Object Service Loggers


# log4j.logger.maximo.service.<business object service>=<level>
# for example:
#   log4j.logger.maximo.service.WORKORDER=INFO
# ~~ Business Object Loggers
# log4j.logger.maximo.service.<service name>.<business object name>=<level>
# for example:
#   log4j.logger.maximo.service.WORKORDER.WOSTATUS=INFO
# ~~ Business Object SQL Loggers
# log4j.logger.maximo.sql.<service name>.<business object name>=<level>
# for example:
#   log4j.logger.maximo.sql.WORKORDER.WOSTATUS=INFO
# ~~ Application Loggers (for JSP UI)
# log4j.logger.maximo.application.<application name>=<level>
# for example:
#   log4j.logger.maximo.application.WOTRACK=INFO
# ~~ CRONTASK loggers
# log4j.logger.maximo.crontask.<cron task name>=<level>
# The cron task name is the name of the java class name
# used for the cron task
# for example:
#   log4j.logger.maximo.crontask.psdi.workflow.EmailNotification=INFO

Maximo 7.1.x, 7.5.x and 7.6.x

Additional loggers added to Maximo 7.1.x, 7.5.x and 7.6.x include:

LoggerFunction
log4j.maximo.crontaskmgrRoot of cron task manager loggers
log4j.maximo.reportRoot of all reports-related logging, including BIRT
log4j.maximo.securityRoot of Maximo security events loggers
log4j.maximo.workflowRoot of Workflow events loggers
log4j.maximo.integrationRoot of Integration Framework loggers
log4j.maximo.exceptionRoot of JMS Queue Exception event loggers
log4j.maximo.dm Root of Migration Manager loggers
log4j.maximo.interactionRoot of Web Services Library Interaction events loggers
log4j.logger.maximo.webclient.uisessionRoot of User Interface Session event loggers
log4j.maximo.dbconnectionDatabase Connection watchdog (DbConnectionWatchDog) logger.

This technote explains how the dbconnection logger is used to resolve database connection leaks.


Maximo 7.5.x and 7.6.x

Additional loggers in Maximo 7.5.x and 7.6.x include:

LoggerFunction
log4j.logger.maximo.jmsJMS queue logger
log4j.logger.maximo.scriptAutomation script events logger
log4j.logger.maximo.schedulerRoot of Scheduler events loggers (when Scheduler is installed)
log4j.logger.maximo.scheduler.sqlRoot of Scheduler SQL events loggers (when Scheduler is installed)
log4j.logger.maximo.rest Root of REST event loggers
log4j.logger.maximo.webclient.eventtrackingEventTracker filter logger. Events are written to a clientevents.log. See link below for more information on enabling this feature
log4j.logger.maximo.traceMethod entry/exit trace logger. Events are written to a trace.log,

See Out of the Box Maximo Loggers for a complete list.

Configuring Maximo Logging

Maximo 6.2.x:

In order to see the log messages, you must make sure that your logger is enabled with the appropriate logging level in the log configuration file. Maximo log configuration is specified in properties\logging.properties file for the Maximo application.

The following is an example of the log configuration information. In this configuration, the root logger is configured to output error and fatal messages to standard output and to the maximo.log file. The maximo root logger is set to output info, warn, error and fatal messages and the log messages are written to standard output and to the maximo.log file in logging.properties file:

# /


log4j.rootLogger=ERROR, A1, A2
# /
# ~~ Output destinations or appenders
#
# A1 is set to be a ConsoleAppender which outputs to System.out.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.target=System.out
log4j.appender.A1.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss:SSS} [%-2p] %m%n
# A2 is set to be a RollingFileAppender which outputs to maximo.log file
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.File=maximo.log
log4j.appender.A2.MaxFileSize=5MB
log4j.appender.A2.MaxBackupIndex=20
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss:SSS} [%-2p] %m%n
log4j.logger.maximo=INFO
log4j.logger.maximo.application=ERROR
log4j.logger.maximo.crontask=ERROR
log4j.logger.maximo.datadictionary=ERROR
log4j.logger.maximo.event=ERROR
log4j.logger.maximo.mail=ERROR
log4j.logger.maximo.service=ERROR
log4j.logger.maximo.sql=ERROR

Maximo 7.1.x, 7.5.x and 7.6.x

See Enabling Logging and Appenders to Log Application Events for details on setting up logging in Maximo 7.x.

Specifying log location: modifying log4j.appender.A2.File location

Maximo 6.2.x:

The default file location is maximo.log. Keeping this setting after turning on logging will place the file maximo.log at the root of the location where the maximo.ear file is located.

In WebLogic, for out-of-the-box installations it is at \bea\user_projects\domains\maxdomain\maxserver\

In WebSphere for out-of-the-box installations it is at \IBM\WebSphere\AppServer\profiles\Custom01\logs\Maximoserver\.

To change the location, modify the log4j.appender.A2.File value from maximo.log to the format

=<drive letter>:\\<directory>\\<subdirectory>\<log_file_name>.log

using double back slashes (\\) where you normally use single back slashes. For example, if you wish to have it on drive f:

log4j.appender.A2.File=f:\\maximologs\\maxprod\\maxprod.log

The file maxprod.log will, if other settings are not changed, be located at f:\maximologs\maxprod.log. which will roll over after the size has reach 5 megabytes, and of which the last twenty versions will be saved.

Maximo 7.1.x, 7.5.x and 7.6.x

See Enabling Logging and Appenders for details on setting up appender file locations in Maximo 7.x.

Enabling SQL Logging

Maximo 6.2.x:

To see SQL statements that are executed by Maximo, set the following setting in the Maximo log configuration file:

log4j.logger.maximo.sql=INFO

By default, this setting would output all SQL statements that are executed by all business objects. To see SQL statements that are execute by a particular Maximo service and its related business objects, set the following setting in the Maximo log configuration file. For example to see all WORKORDER service related SQL statements:

log4j.logger.maximo.sql=ERROR


log4j.logger.maximo.sql.WORKORDER=INFO

The above settings would output SQL statements that are executed by all business objects of the WORKORDER service. To see SQL statements that are executed by a particular business object only, place the following setting in the Maximo log configuration file to see all WOSTATUS business object SQL statements

log4j.logger.maximo.sql=ERROR


log4j.logger.maximo.sql.WORKORDER=ERROR
log4j.logger.maximo.sql.WORKORDER.WOSTATUS=INFO

Maximo 7.1.x, 7.5.x and 7.6.x

Usage of SQL Loggers in Maximo 7.1.x , 7.5.x and 7.6.x are described above. The Logging application already contains two SQL loggers (log4j.logger.maximo.sql.WORKORDER.WOSTATUS=INFO and log4j.logger.maximo.sql.crontask.EmailNotification=INFO), as above. You can create, delete and make active or inactive by adding and deleting rows on the sql root logger.

Enable Business Object Logging

Maximo 6.2.x:

To see messages that are output by Maximo business object (mbo) code, set the following setting in the Maximo log configuration file:

log4j.logger.maximo.service=INFO

By default, this setting would output all general messages for all business objects. To see messages that are output by a particular Maximo service and its related business objects, set the following setting in the Maximo log configuration file. To see all WORKORDER service related messages do the following:

log4j.logger.maximo.service=ERROR


log4j.logger.maximo.service.WORKORDER=INFO

The above settings would output general messages for all business objects of the WORKORDER service. To see messages that are output by a particular business object only, place the following setting in the Maximo log configuration file to see all WOSTATUS business object messages:

log4j.logger.maximo.service=ERROR


log4j.logger.maximo.service.WORKORDER=ERROR
log4j.logger.maximo.service.WORKORDER.WOSTATUS=INFO

Maximo 7.1.x, 7.5.x and 7.6.x

Usage of Maximo Business Object Loggers in Maximo 7.1.x, 7.5.x and 7.6.x are described above. The Logging Application already contains several service loggers, for example,

log4j.logger.maximo.service.BIRTREPORT


log4j.logger.maximo.service.WORKORDER
log4j.logger.maximo.service.CONFIGURE
log4j.logger.maximo.service.WORKORDER.WOSTATUS

You can create, delete and make active or inactive service loggers by adding and deleting rows on the service root logger.

[{"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Business Unit":{"code":"BU055","label":"Cognitive Applications"},"Component":"System Related","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"6.2.1;6.2.2;6.2.3;6.2.4;6.2.5;6.2.6;6.2.7;6.2.8;7.1.1;7.5;7.6","Edition":"","Line of Business":{"code":"LOB02","label":"AI Applications"}},{"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Business Unit":{"code":"BU055","label":"Cognitive Applications"},"Component":"System Related","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB02","label":"AI Applications"}},{"Product":{"code":"SSLKTY","label":"Tivoli Asset Management for IT"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Not Applicable","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB15","label":"Integration"}},{"Product":{"code":"SS6HJK","label":"Tivoli Service Request Manager"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Not Applicable","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB15","label":"Integration"}},{"Product":{"code":"SSKTXT","label":"Tivoli Change and Configuration Management Database"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Not Applicable","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB15","label":"Integration"}},{"Product":{"code":"SSWT9A","label":"Control Desk"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":null,"Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB26","label":"Storage"}}]

Historical Number

M04685

Product Synonym

MAXIMO

Document Information

Modified date:
17 June 2018

UID

swg21264064