ch.qos.logback.classic
Class LoggerContext
java.lang.Object
ch.qos.logback.core.ContextBase
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
LoggerContext
public LoggerContext()
putProperty
public void putProperty(String key,
String val)
- Specified by:
putProperty
in interface Context
- Overrides:
putProperty
in class ContextBase
setName
public void setName(String name)
- Specified by:
setName
in interface Context
- Overrides:
setName
in class ContextBase
getLogger
public final Logger getLogger(Class clazz)
getLogger
public final Logger getLogger(String name)
- Specified by:
getLogger
in interface org.slf4j.ILoggerFactory
exists
public Logger exists(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 List<Logger> getLoggerList()
getLoggerContextRemoteView
public LoggerContextVO getLoggerContextRemoteView()
setPackagingDataEnabled
public void setPackagingDataEnabled(boolean packagingDataEnabled)
isPackagingDataEnabled
public boolean isPackagingDataEnabled()
reset
public void reset()
- This method clears all internal properties, closes all appenders, removes
any turboFilters, fires an OnReset event, removes all status listeners,
removes all context listeners (except those which are reset resistant).
- Overrides:
reset
in class ContextBase
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 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 String toString()
- Overrides:
toString
in class Object
getMaxCallerDataDepth
public int getMaxCallerDataDepth()
setMaxCallerDataDepth
public void setMaxCallerDataDepth(int maxCallerDataDepth)
Copyright © 2005-2010 QOS.ch. All Rights Reserved.