public class LoggerContext extends ContextBase implements org.slf4j.ILoggerFactory, LifeCycle
ILoggerFactory
acting as the
manufacturing source of Logger
instances.Constructor and Description |
---|
LoggerContext() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(LoggerContextListener listener) |
void |
addTurboFilter(TurboFilter newFilter) |
Logger |
exists(String name)
Check if the named logger exists in the hierarchy.
|
List<LoggerContextListener> |
getCopyOfListenerList() |
List<String> |
getFrameworkPackages()
List of packages considered part of the logging framework such that they are never considered
as callers of the logging framework.
|
Logger |
getLogger(Class clazz) |
Logger |
getLogger(String name) |
LoggerContextVO |
getLoggerContextRemoteView() |
List<Logger> |
getLoggerList() |
int |
getMaxCallerDataDepth() |
String |
getProperty(String key)
Given a key, return the corresponding property value.
|
TurboFilterList |
getTurboFilterList() |
boolean |
isPackagingDataEnabled() |
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 |
resetTurboFilterList()
First processPriorToRemoval all registered turbo filters and then clear the registration
list.
|
void |
setMaxCallerDataDepth(int maxCallerDataDepth) |
void |
setName(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 |
setPackagingDataEnabled(boolean packagingDataEnabled) |
void |
start() |
void |
stop() |
String |
toString() |
getBirthTime, getConfigurationLock, getCopyOfPropertyMap, getExecutorService, getName, getObject, getStatusManager, isStarted, putObject, register, setStatusManager
public String getProperty(String key)
ContextBase
getProperty
in interface Context
getProperty
in interface PropertyContainer
getProperty
in class ContextBase
key
- the property's keypublic void putProperty(String key, String val)
Context
putProperty
in interface Context
putProperty
in class ContextBase
key
- the property's keyval
- the value associated with the keypublic void setName(String name)
ContextBase
setName
in interface Context
setName
in class ContextBase
name
- the desired context namepublic final Logger getLogger(String name)
getLogger
in interface org.slf4j.ILoggerFactory
public Logger exists(String name)
null
.name
- the name of the logger to search for.public LoggerContextVO getLoggerContextRemoteView()
public void setPackagingDataEnabled(boolean packagingDataEnabled)
public boolean isPackagingDataEnabled()
public void reset()
As mentioned above, internal status messages survive resets.
reset
in class ContextBase
public TurboFilterList getTurboFilterList()
public void addTurboFilter(TurboFilter newFilter)
public void resetTurboFilterList()
public void addListener(LoggerContextListener listener)
public void removeListener(LoggerContextListener listener)
public List<LoggerContextListener> getCopyOfListenerList()
public void start()
start
in interface LifeCycle
start
in class ContextBase
public void stop()
stop
in interface LifeCycle
stop
in class ContextBase
public String toString()
toString
in class ContextBase
public int getMaxCallerDataDepth()
public void setMaxCallerDataDepth(int maxCallerDataDepth)
public List<String> getFrameworkPackages()
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.
Copyright © 2005–2014 QOS.ch. All rights reserved.