Overview of rsh-logging
Table of Contents
Design Goals
The rsh-logging package exists for one reason:To make logging so simple that developers have no excuse not to use it in all their code.
With that mission in mind, rsh-logging was designed to accomplish two primary goals:
- Make using either the JDK Logger or the Log4J Logger simple and hidden from the end user (they shouldn't know or care which one they are using).
- Make logging configuration simple and dead-easy no matter what logging toolkit you are using.
and everything is taken care of for them. If they set some package to level=FINE, it works. If they set another to level=debug, it works.
Component Overview
While there are several classes at work in the rsh-logging package, the only one users care about is the LoggingUtil
utility class. This class is used to wrap getting at the Log object. Its purpose is to ensure any configuration steps needed to use the toolkit have been taken before the Log object is returned. Initialization only takes place once, and from there on out, the LoggingUtil uses the Apache Commons Logging package to retrieve a Log object from the underlying toolkit.
Configuration of the toolkit is deferred to the LoggingConfigurator implementations, called through the ConfiguratorUtil class. Any toolkit or framework specific code is contained within these implementations. While you made need both the JDK Logger and Log4J to compile rsh-logging, you only need which ever one you plan on using in order to use rsh-logging. This allows rsh-logging to lean heavily on Java's dynamic loading and linking abilities. Whatever toolkit you use, only then is the toolkit specifc configuration code called (if at all).
/rsh tech

