java.lang.Object
ch.qos.logback.core.ContextBase
ch.qos.logback.classic.LoggerContext
- All Implemented Interfaces:
Context
,LifeCycle
,PropertyContainer
,org.slf4j.ILoggerFactory
LoggerContext glues many of the logback-classic components together. In
principle, every logback-classic component instance is attached either
directly or indirectly to a LoggerContext instance. Just as importantly
LoggerContext implements the
ILoggerFactory
acting as the
manufacturing source of Logger
instances.- Author:
- Ceki Gulcu
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
Default setting of packaging data in stack tracesFields inherited from class ch.qos.logback.core.ContextBase
scheduledFutures
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(LoggerContextListener listener) void
addTurboFilter
(TurboFilter newFilter) Check if the named logger exists in the hierarchy.List of packages considered part of the logging framework such that they are never considered as callers of the logging framework.final Logger
int
org.slf4j.spi.MDCAdapter
boolean
void
putProperty
(String key, String val) Set a property of this context.void
removeListener
(LoggerContextListener listener) void
reset()
This method clears all internal properties, except internal status messages, closes all appenders, removes any turboFilters, fires an OnReset event, removes all status listeners, removes all context listeners (except those which are reset resistant).void
First processPriorToRemoval all registered turbo filters and then clear the registration list.void
setMaxCallerDataDepth
(int maxCallerDataDepth) void
setMDCAdapter
(org.slf4j.spi.MDCAdapter anAdapter) void
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
setPackagingDataEnabled
(boolean packagingDataEnabled) void
void
start()
void
stop()
toString()
Methods inherited from class ch.qos.logback.core.ContextBase
addConfigurationEventListener, addScheduledFuture, addSubstitutionProperty, fireConfigurationEvent, getAlternateExecutorService, getBirthTime, getConfigurationLock, getCopyOfPropertyMap, getCopyOfScheduledFutures, getExecutorService, getName, getObject, getProperty, getScheduledExecutorService, getScheduledFutures, getStatusManager, initCollisionMaps, isStarted, putObject, register, removeObject, setStatusManager
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.qos.logback.core.spi.PropertyContainer
addSubstitutionProperties
-
Field Details
-
DEFAULT_PACKAGING_DATA
Default setting of packaging data in stack traces- See Also:
-
-
Constructor Details
-
LoggerContext
public LoggerContext()
-
-
Method Details
-
putProperty
Description copied from interface:Context
Set a property of this context.- Specified by:
putProperty
in interfaceContext
- Overrides:
putProperty
in classContextBase
-
setName
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 interfaceContext
- Overrides:
setName
in classContextBase
- Parameters:
name
-
-
getLogger
-
getLogger
- Specified by:
getLogger
in interfaceorg.slf4j.ILoggerFactory
-
exists
Check if the named logger exists in the hierarchy. If so return its reference, otherwise returnsnull
.- Parameters:
name
- the name of the logger to search for.
-
getLoggerList
-
getLoggerContextRemoteView
-
setPackagingDataEnabled
-
isPackagingDataEnabled
-
getTurboFilterList
-
addTurboFilter
-
resetTurboFilterList
First processPriorToRemoval all registered turbo filters and then clear the registration list. -
addListener
-
removeListener
-
getCopyOfListenerList
-
start
- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classContextBase
-
stop
- Specified by:
stop
in interfaceLifeCycle
- Overrides:
stop
in classContextBase
-
reset
This method clears all internal properties, except internal status messages, closes all appenders, removes any turboFilters, fires an OnReset event, removes all status listeners, removes all context listeners (except those which are reset resistant). As mentioned above, internal status messages survive resets.- Overrides:
reset
in classContextBase
-
toString
- Overrides:
toString
in classContextBase
-
getMaxCallerDataDepth
-
setMaxCallerDataDepth
-
getFrameworkPackages
List of packages considered part of the logging framework such that they are never considered as callers of the logging framework. This list used to compute the caller for logging events. To designate package "com.foo" as well as all its subpackages as being part of the logging framework, simply add "com.foo" to this list.- Returns:
- list of framework packages
-
setSequenceNumberGenerator
- Specified by:
setSequenceNumberGenerator
in interfaceContext
- Overrides:
setSequenceNumberGenerator
in classContextBase
-
getSequenceNumberGenerator
- Specified by:
getSequenceNumberGenerator
in interfaceContext
- Overrides:
getSequenceNumberGenerator
in classContextBase
-
getMDCAdapter
-
setMDCAdapter
-