19.1 Configuring Logging

You can configure logging to troubleshoot errors, or to receive notification for specific events. You can also configure logging to perform the following activities:

  • Allow recording of Info level messages from the HTTP subsystem in the log file.

  • Track log information for individual servers in a cluster.

  • Configure an appender to publish messages only whose severity level is warning or higher.

  • Stop recording of Debug and Info messages in the log file.

You may need to configure the logging.properties file in some cases.

The following sections describe the basic tasks involved in logging configuration:

19.1.1 Understanding Logging Configuration

When you enable logging, the Workflow Administration Console sends a logging request to the subscribed appenders. Tomcat provides appenders for sending log messages to the standard.out file and the server log file (catalina.out). You can control logging for each type of handler by filtering log messages based on severity level and other criteria. For example, the Stdout handler has a notice threshold severity level by default. Therefore, Info and Debug level messages are not sent to the standard.out file.

By default, event messages are logged to the system console and to the Tomcat server log file at the Info logging level and above. Events are logged to all activated loggers.

The default behavior of the Tomcat server is to limit the console appender to display log messages with a verbosity of “Info” or less. To see log messages for more verbose levels (for example, Debug), examine the server log file. Low threshold settings, such as debug are extremely verbose and will increase the startup time for Tomcat.

19.1.2 Understanding the Log Level Settings

Console logging involves synchronized writes, so, logging can use a lot of processor resources and impede concurrency. To solve these issues, you can change the priority value default setting to error by accessing Configuration > Logging, or by updating the workflow_logging.xml file. Locate the root node that looks similar to this:

<root>
      <priority value="INFO"/>
</root>

Change the priority value to:

<root>
      <priority value="ERROR"/>
          
</root>

Assigning a value to the root ensures that, appenders do not have a level assigned that inherits the level of the root.

19.1.3 Specifying the Severity Level for Commons Logging API Loggers

If you are using the commons logging API, the logger names follow the Java package dot notation naming convention. For example, a logger name can be com.acme.Barlogger, corresponding to the name of the classes in which it is used. Each dot-separated identifier appears as a node in the logger. In this case, the logger named com.acme is a parent of the logger named com.acme.Barlogger.

You can configure the severity for a package or for any logger at any level in the tree. For example, if you specify the severity level for package com.acme=Warn, then Fatal and Error messages from the child nodes of this package will be blocked. You can override the severity level of a parent node by setting a value for a child node. For example, if you specify the severity level for com.acme.Barlogger=Debug, all log messages from Barlogger will be allowed, while Fatal and Error messages will be filtered for other child nodes under com.acme.

You can specify the severity level for a package in Workflow Administration Console by accessing Configuration > Logging. The changes will be immediately applied. When you restart the application, the changes will not be preserved. To persist the changes in the database for subsequent sessions, select Persist the logging changes.

NOTE:If you change, enable, or disable logging, you do not have to restart Workflow Administration Console to apply the changes.

19.1.4 Editing the Logging Configuration File

The configuration settings for the Workflow Administration Console logging are stored in the workflow_logging.xml file, located in the install directory on the Tomcat server. To configure the logging levels and other settings permanently, stop the Tomcat server and change the settings in these files.

NOTE:All loggers specific to the Workflow Administration Console are defined in workflow_logging.xml.

To change the log level in the workflow_logging.xml file, open the file in a text editor and locate the following entry at the end of the file:

<root>
    <priority value="INFO" /> 
      <appender-ref ref="CONSOLE" /> 

  </root>

Assigning a value to root ensures that any log appenders that do not have a level explicitly assigned will inherit the root level (in this case, Info). For example, the file appender does not have a default threshold level assigned. It assumes the root’s threshold level.

The log levels used are Debug, Info, Warn, Error, and Fatal. Inappropriate use of these settings can be costly in terms of performance.

A good rule of thumb is to use Info or Debug only when debugging a particular problem.

Any appender included in the root that does have a level threshold set, should have that threshold set to Error, Warn, or Fatal unless you are debugging something.

The performance issues associated with high log levels has less to do with verbosity of messages than with the fact that console and file logging involves synchronous writes.

The default log level of Info in the log configuration file for the Workflow Administration Console is suitable for many environments. However, for a performance intensive environment, you can change the entry as follows:

<root>
      <priority value="ERROR"/>
      
</root>

NOTE:Enabling Info and console logging is not needed for a fully tested and debugged production setup.

19.1.5 Managing Log File Size

By default, event messages are logged in the following places:

  • The system console of the application server where you deployed the Workflow Administration Console

  • A log file on that Tomcat server. For example: /opt/netiq/idm/apps/tomcat/logs/catalina.out

    This is a rolling log file. By default, the server rotates the file every 24 hours. The server does not rotate the local server log file when you start the server.

To immediately rotate the log file, change the appender configuration in the logging configuration file. By default, the rotated files are stored in the same directory as the log file.