ch.qos.logback.classic
Class LoggerContext

java.lang.Object
  extended by ch.qos.logback.core.ContextBase
      extended by ch.qos.logback.classic.LoggerContext
All Implemented Interfaces:
Context, LifeCycle, PropertyContainer, org.slf4j.ILoggerFactory

public class LoggerContext
extends ContextBase
implements org.slf4j.ILoggerFactory, LifeCycle

LoggerContext glues many of the logback-classic components together. In principle, every logback-classic component instance is attached either directly or indirecty to a LoggerContext instance. Just as importantly LoggerContext implements the ILoggerFactory acting as the manufacturing source of Logger instances.

Author:
Ceki Gulcu

Field Summary
static java.lang.String ROOT_NAME
           
 
Constructor Summary
LoggerContext()
           
 
Method Summary
 void addListener(LoggerContextListener listener)
           
 void addTurboFilter(TurboFilter newFilter)
           
 Logger exists(java.lang.String name)
          Check if the named logger exists in the hierarchy.
 java.util.List<LoggerContextListener> getCopyOfListenerList()
           
 Logger getLogger(java.lang.Class clazz)
           
 Logger getLogger(java.lang.String name)
           
 LoggerContextRemoteView getLoggerContextRemoteView()
           
 java.util.List<Logger> getLoggerList()
           
 TurboFilterList getTurboFilterList()
           
 boolean isStarted()
           
 void putProperty(java.lang.String key, java.lang.String val)
          Set a property of this context.
 void removeListener(LoggerContextListener listener)
           
 void reset()
          This method closes all appenders,
 void resetTurboFilterList()
          First stop all registered turbo filters and then clear the registration list.
 void setName(java.lang.String name)
          The context name can be set only if it is not already set, or if the current name is the default context name, namely "default", or if the current name and the old name are the same.
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class ch.qos.logback.core.ContextBase
getCopyOfPropertyMap, getName, getObject, getProperty, getStatusManager, putObject, setStatusManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ROOT_NAME

public static final java.lang.String ROOT_NAME
See Also:
Constant Field Values
Constructor Detail

LoggerContext

public LoggerContext()
Method Detail

putProperty

public void putProperty(java.lang.String key,
                        java.lang.String val)
Description copied from interface: Context
Set a property of this context.

Specified by:
putProperty in interface Context
Overrides:
putProperty in class ContextBase

setName

public void setName(java.lang.String name)
Description copied from class: ContextBase
The context name can be set only if it is not already set, or if the current name is the default context name, namely "default", or if the current name and the old name are the same.

Specified by:
setName in interface Context
Overrides:
setName in class ContextBase

getLogger

public final Logger getLogger(java.lang.Class clazz)

getLogger

public final Logger getLogger(java.lang.String name)
Specified by:
getLogger in interface org.slf4j.ILoggerFactory

exists

public Logger exists(java.lang.String name)
Check if the named logger exists in the hierarchy. If so return its reference, otherwise returns null.

Parameters:
name - the name of the logger to search for.

getLoggerList

public java.util.List<Logger> getLoggerList()

getLoggerContextRemoteView

public LoggerContextRemoteView getLoggerContextRemoteView()

reset

public void reset()
This method closes all appenders,


getTurboFilterList

public TurboFilterList getTurboFilterList()

addTurboFilter

public void addTurboFilter(TurboFilter newFilter)

resetTurboFilterList

public void resetTurboFilterList()
First stop all registered turbo filters and then clear the registration list.


addListener

public void addListener(LoggerContextListener listener)

removeListener

public void removeListener(LoggerContextListener listener)

getCopyOfListenerList

public java.util.List<LoggerContextListener> getCopyOfListenerList()

isStarted

public boolean isStarted()
Specified by:
isStarted in interface LifeCycle

start

public void start()
Specified by:
start in interface LifeCycle

stop

public void stop()
Specified by:
stop in interface LifeCycle

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object