org.jlog2
Class LoggerFactory

java.lang.Object
  extended by org.jlog2.LoggerFactory
Direct Known Subclasses:
CustomLoggerFactory

public abstract class LoggerFactory
extends java.lang.Object

This abstract class must be implemented to return logger instances for each specific logger type.


Field Summary
protected  java.util.Hashtable debugChannels
          The debug channels mapped to the appropriate logger ids.
protected  java.util.Vector defaultDebugChannels
          Default debug channels to be added to every logger.
protected  java.util.Vector defaultLogChannels
          Default log channels to be added to every logger.
protected  java.util.Hashtable logChannels
          The log channels mapped to the appropriate logger ids.
 
Constructor Summary
LoggerFactory()
          Create a new instance of LoggerFactory.
 
Method Summary
 void addDefaultDebugChannels(java.util.Vector theLogChannels)
          Add default channels to write the debug messages to.
 void addDefaultLogChannels(java.util.Vector theLogChannels)
          Add default channels to write the log messages to.
protected abstract  java.util.Vector getDebugChannels(java.lang.String loggerID)
          Create and store any new debug channels associated with the new log id.
static java.lang.String getDebugLevel()
          Get the level to debug messages to.
protected  java.util.Vector getDefaultDebugChannels()
          Get any default channels to write the debug messages to.
protected  java.util.Vector getDefaultLogChannels()
          Get any default channels to write the log messages to.
protected abstract  java.util.Vector getLogChannels(java.lang.String loggerID)
          Create and store any new log channels associated with the new log id.
abstract  Logger getLoggerInstance(java.lang.String loggerID)
          Create a new instance of Logger.
static java.lang.String getLogLevel()
          Get the level to log messages to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultLogChannels

protected java.util.Vector defaultLogChannels
Default log channels to be added to every logger. Of type LogChannel.


defaultDebugChannels

protected java.util.Vector defaultDebugChannels
Default debug channels to be added to every logger. Of type LogChannel.


logChannels

protected java.util.Hashtable logChannels
The log channels mapped to the appropriate logger ids. Keys are the logger ids of type String and values are the log channels of type LogChannels.


debugChannels

protected java.util.Hashtable debugChannels
The debug channels mapped to the appropriate logger ids. Keys are the logger ids of type String and values are the debug channels of type LogChannels.

Constructor Detail

LoggerFactory

public LoggerFactory()
              throws java.lang.Exception
Create a new instance of LoggerFactory.

Throws:
java.lang.Exception - any error.
Method Detail

getLoggerInstance

public abstract Logger getLoggerInstance(java.lang.String loggerID)
Create a new instance of Logger.

Parameters:
loggerID - the id to identify one logger from another.
Returns:
the newly created logger.

addDefaultLogChannels

public void addDefaultLogChannels(java.util.Vector theLogChannels)
Add default channels to write the log messages to.

Parameters:
theLogChannels - the channels to write the log messages to. Of type LogChannel.

addDefaultDebugChannels

public void addDefaultDebugChannels(java.util.Vector theLogChannels)
Add default channels to write the debug messages to.

Parameters:
theLogChannels - the channels to write the debug messages to. Of type LogChannel.

getDefaultLogChannels

protected java.util.Vector getDefaultLogChannels()
Get any default channels to write the log messages to.

Returns:
a list of all default log channels.

getDefaultDebugChannels

protected java.util.Vector getDefaultDebugChannels()
Get any default channels to write the debug messages to.

Returns:
a list of all default debug channels.

getLogChannels

protected abstract java.util.Vector getLogChannels(java.lang.String loggerID)
Create and store any new log channels associated with the new log id.

Parameters:
loggerID - the id to identify one logger from another.
Returns:
a list of all log channels associated with the logger.

getDebugChannels

protected abstract java.util.Vector getDebugChannels(java.lang.String loggerID)
Create and store any new debug channels associated with the new log id.

Parameters:
loggerID - the id to identify one logger from another.
Returns:
a list of all debug channels associated with the logger.

getLogLevel

public static java.lang.String getLogLevel()
Get the level to log messages to.

Returns:
the value of logLevel.

getDebugLevel

public static java.lang.String getDebugLevel()
Get the level to debug messages to.

Returns:
the value of debugLevel.