org.jlog2
Class CustomLoggerFactory

java.lang.Object
  extended by org.jlog2.LoggerFactory
      extended by org.jlog2.CustomLoggerFactory

public class CustomLoggerFactory
extends LoggerFactory

This class is an implementation of the logger factory to return the default logger functionality. You can implement your own version instead.


Field Summary
 
Fields inherited from class org.jlog2.LoggerFactory
debugChannels, defaultDebugChannels, defaultLogChannels, logChannels
 
Constructor Summary
CustomLoggerFactory()
          Creates a new instance of CustomLoggerFactory.
 
Method Summary
protected  java.util.Vector getDebugChannels(java.lang.String loggerID)
          Create and store any new debug channels associated with the new log id.
protected  java.util.Vector getLogChannels(java.lang.String loggerID)
          Create and store any new log channels associated with the new log id.
 Logger getLoggerInstance(java.lang.String loggerID)
          Create a new instance of Logger.
 
Methods inherited from class org.jlog2.LoggerFactory
addDefaultDebugChannels, addDefaultLogChannels, getDebugLevel, getDefaultDebugChannels, getDefaultLogChannels, getLogLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomLoggerFactory

public CustomLoggerFactory()
                    throws java.lang.Exception
Creates a new instance of CustomLoggerFactory.

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

getLoggerInstance

public Logger getLoggerInstance(java.lang.String loggerID)
Create a new instance of Logger. Every call creates a new instance, but the channels to write the messages to might be duplicated.

Specified by:
getLoggerInstance in class LoggerFactory
Parameters:
loggerID - the id to identify one logger from another.
Returns:
the newly created logger.

getLogChannels

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

Specified by:
getLogChannels in class LoggerFactory
Parameters:
loggerID - the id to identify one logger from another.
Returns:
a list of all log channels associated with the logger. This default implementation only adds the default channels created at initialisation time for all loggers.

getDebugChannels

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

Specified by:
getDebugChannels in class LoggerFactory
Parameters:
loggerID - the id to identify one logger from another.
Returns:
a list of all debug channels associated with the logger. This default implementation only adds the default channels created at initialisation time for all loggers.