How to Enable Logging

This page provides simple instructions for enabling OGSA-DAI logging. OGSA-DAI logging is based upon Apache Log4J. For full details of Apache Log4J configuration please refer to the Log4J documentation.

What are the OGSA-DAI logging levels?

The levels we use are those used by Apache Log4J. These levels, and the information within OGSA-DAI which is logged at those levels, are as follows:

As logging carries an overhead we recommend that the minimum level you use in a production system is INFO and that you only enable the DEBUG when you have encountered serious problems (typically the OGSA-DAI team will recommend this when assisting in resolving any support queries for example).

How to enable logging within OGSA-DAI WSI

The steps below explain how to configure Log4J to log all messages to a rolling file. This is a file with a limited size and when the limit is reached the file will be renamed by appending a count to the filename, then a new file will be created.

  1. If you have not already done so, create a file called log4j.properties.
  2. Move the file to the classes directory of your container.
  3. Shutdown and restart your container.

To enable logging within OGSA-DAI WSRF

The steps below explain how to configure Log4J to log all messages to the a log file - if using Tomcat - or the console - if using the Globus Toolkit Web services container.

  1. Edit one of the following files:
  2. Beneath the line:
    log4j.category.org.globus=INFO
    
    Add the following line:
    log4j.category.uk.org.ogsadai=YOUR-LEVEL
    
    where YOUR-LEVEL is your chosen logging level (one of DEBUG INFO, WARN ERROR, OR FATAL)
  3. Save the file.
  4. Ensure the container's lib directory contains the log4j jar file (e.g. log4j-1.2.8.jar).
  5. Restart the container.

To log messages to a file instead of the console for the Globus Web services container, it is necessary to add a file appender or rolling file appender to the Log4J configuration file. This approach is shown in the OGSA-DAI WSI example above and is explained in more detail in the Log4J manual. Note that for the Globus container, console log messages are displayed within the console in which the container was started.