Holger's
Java API

com.antelmann.util.logging
Class LoggerManager

java.lang.Object
  extended by com.antelmann.util.logging.LoggerManager
All Implemented Interfaces:
Factory<Logger>

public class LoggerManager
extends Object
implements Factory<Logger>

a central point to manager different Logger instances

Author:
Holger Antelmann

Method Summary
 Logger createInstance(EventObject eo)
          creates a new instance of the factory type on each call based on the given event
static Logger getDefaultlogger()
           
 Handler<Logger,?> getHandler()
           
static LoggerManager getInstance()
           
 Logger getLogger(Object obj)
          if no specific logger is available, the default logger is returned, so that this method never returns null
 Logger getLoggerFor(Object obj)
          if no logger had been specified for the given obj, this method returns null
 Set<Object> getLoggerObjects()
           
 Logger getOrCreateLoggerFor(Object obj)
           
 void removeAll()
           
 Logger removeLoggerFor(Object obj)
           
 void setHandler(Handler<Logger,?> handler)
           
 Logger setLogger(Object obj, Logger logger)
           
static
<T> LogEntryFormatter<T>
toFormatter(PatternExtractor<LogEntry,T> pe)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHandler

public Handler<Logger,?> getHandler()

setHandler

public void setHandler(Handler<Logger,?> handler)

createInstance

public Logger createInstance(EventObject eo)
                      throws Exception
Description copied from interface: Factory
creates a new instance of the factory type on each call based on the given event

Specified by:
createInstance in interface Factory<Logger>
Parameters:
eo - the event that triggered this instance creation; normally, this method should also cope with the event to be null.
Throws:
Exception

getDefaultlogger

public static Logger getDefaultlogger()

getInstance

public static LoggerManager getInstance()

setLogger

public Logger setLogger(Object obj,
                        Logger logger)

removeLoggerFor

public Logger removeLoggerFor(Object obj)

removeAll

public void removeAll()

getLoggerObjects

public Set<Object> getLoggerObjects()

getOrCreateLoggerFor

public Logger getOrCreateLoggerFor(Object obj)

getLogger

public Logger getLogger(Object obj)
if no specific logger is available, the default logger is returned, so that this method never returns null


getLoggerFor

public Logger getLoggerFor(Object obj)
if no logger had been specified for the given obj, this method returns null


toFormatter

public static <T> LogEntryFormatter<T> toFormatter(PatternExtractor<LogEntry,T> pe)


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads