|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.core.LoggerContext
public class LoggerContext
The LoggerContext is the anchor for the logging system. It maintains a list of all the loggers requested by applications and a reference to the Configuration. The Configuration will contain the configured loggers, appenders, filters, etc and will be atomically updated whenever a reconfigure occurs.
Constructor Summary | |
---|---|
LoggerContext(String name)
Constructor taking only a name. |
|
LoggerContext(String name,
Object externalContext)
Constructor taking a name and a reference to an external context. |
|
LoggerContext(String name,
Object externalContext,
String configLocn)
Constructor taking a name external context and a configuration location String. |
|
LoggerContext(String name,
Object externalContext,
URI configLocn)
Constructor taking a name, external context and a configuration URI. |
Method Summary | |
---|---|
void |
addFilter(Filter filter)
Add a Filter to the Configuration. |
Configuration |
getConfiguration()
Return the current Configuration. |
Object |
getExternalContext()
Return the external context. |
Logger |
getLogger(String name)
Obtain a Logger from the Context. |
boolean |
hasLogger(String name)
Determine if the specified Logger exists. |
boolean |
isStarted()
|
void |
onChange()
Cause a reconfiguration to take place when the underlying configuration file changes. |
void |
reconfigure()
Reconfigure the context. |
void |
removeFiler(Filter filter)
Removes a Filter from the current Configuration. |
Configuration |
setConfiguration(Configuration config)
Set the Configuration to be used. |
void |
setExternalContext(Object context)
Set the external context. |
void |
start()
|
void |
stop()
|
void |
updateLoggers()
Cause all Loggers to be updated against the current Configuration. |
void |
updateLoggers(Configuration config)
Cause all Logger to be updated against the specified Configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoggerContext(String name)
name
- The context name.public LoggerContext(String name, Object externalContext)
name
- The context name.externalContext
- The external context.public LoggerContext(String name, Object externalContext, URI configLocn)
name
- The context name.externalContext
- The external context.configLocn
- The location of the configuration as a URI.public LoggerContext(String name, Object externalContext, String configLocn)
name
- The configuration location.externalContext
- The external context.configLocn
- The configuration location.Method Detail |
---|
public void start()
start
in interface Lifecycle
public void stop()
stop
in interface Lifecycle
public boolean isStarted()
isStarted
in interface Lifecycle
public void setExternalContext(Object context)
context
- The external context.public Object getExternalContext()
getExternalContext
in interface LoggerContext
public Logger getLogger(String name)
getLogger
in interface LoggerContext
name
- The name of the Logger to return.
public boolean hasLogger(String name)
hasLogger
in interface LoggerContext
name
- The Logger name to search for.
public Configuration getConfiguration()
public void addFilter(Filter filter)
filter
- The Filter to add.public void removeFiler(Filter filter)
filter
- The Filter to remove.public Configuration setConfiguration(Configuration config)
config
- The new Configuration.
public void reconfigure()
public void updateLoggers()
public void updateLoggers(Configuration config)
config
- The Configuration.public void onChange()
onChange
in interface ConfigurationListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |