Globus Toolkit 4: Programming Java Services

Chapter 9: Logging

This chapter introduces an interesting utility included with GT4 Java WS Core which we will use in many of the examples in the rest of the book. Using the Apache Jakarta Commons Logging (http://jakarta.apache.org/commons/logging/) component and the Log4j Logging Engine (http://logging.apache.org/log4j/), we will be able to print a log of interesting events (warnings, error, debug information, etc.) to the console or to a file. In this short chapter we will see how to add logginig to our first example. You can find a modified version of the first example (with logging added) in the following directory of the examples bundle:

      $EXAMPLES_DIR/org/globus/examples/services/core/logging/

9.1 The Jakarta Commons Logging Architecture

The goal of the Apache Jakarta Commons Project (http://jakarta.apache.org/commons/) is the development of reusable Java components, such as validation classes, command line option parsers, etc. One of the components in this project is the Commons Logging component, which allows us to easily produce a log from our Java class.

The Commons Logging component has 6 levels of logging. This means that we are not limited to just one type of log message, but 6 types of messages with varying degree of "severity". This allows us to filter the types of messages, so we have a log with only the information we want. For example, at one point we might be interested in producing a log with all the debugging information, but later on we will probably only want a log with errors and warnings produced by our...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Logging and Forestry Equipment
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.