Skip to Content.
Sympa Menu

shibboleth-dev - Logging

Subject: Shibboleth Developers

List archive

Logging


Chronological Thread 
  • From: Walter Hoehn <>
  • To:
  • Subject: Logging
  • Date: Thu, 13 Jun 2002 16:14:25 -0400

Developers,

I have added a servlet to each dist target's deployment descriptor that reads in a configuration file and initializes a logging package called Log4J. Log4J is nice a couple of ways:

It allows for deciding at runtime whether log messages should be output.
It has a flexible system for configuring what log messages look like.
It has a flexible system for determining the destination of messages.
It's fast.
It's easy to use.

So, I guess my suggestion is that we sort of standardize logging in the different shibboleth components and use log4j. If a couple of you could try it out and comment on whether or not this sounds like a good idea, I would be appreciative.

In order to use it, you need to add a static member to your classes.

private static Logger log = Logger.getLogger(LogServ.class.getName());

Replace "LogServ" with the name of the class you are modifying.

Then, you just add messages to the logger by calling one of a couple of methods as appropriate. For example:

log.info("Logger initialized.");

You choose which log.* method to call based on the "level" of the message you wish to output. The default levels are "DEBUG", "INFO", "ERROR", and "FATAL", each with a respective method in the Logger class. Below i s a breakdown of when you would useeach one.

log.fatal() - An error that will cause the application to abort
log.error() - Ummm... an error :-)
log.warn() - A potential problem or point of interest
log.info() - Informational messages, used to chart application flow
log.debug() - detailed status information

That is pretty much all you need to know to get started.

-Walter



--
-------------------------
Walter F. Hoehn, Jr
Systems Programmer
Columbia University - EPIC
-------------------------



------------------------------------------------------mace-shib-design-+
For list utilities, archives, subscribe, unsubscribe, etc. please visit the
ListProc web interface at
http://archives.internet2.edu/

------------------------------------------------------mace-shib-design--




Archive powered by MHonArc 2.6.16.

Top of Page