public interface LoggerRepository
LoggerRepository
is used to create and retrieve Loggers
.
The relation between loggers in a repository depends on the repository but typically loggers are arranged in a named hierarchy.
In addition to the creational methods, a LoggerRepository
can be queried for existing loggers, can act
as a point of registry for events related to loggers.
Modifier and Type | Method and Description |
---|---|
void |
addHierarchyEventListener(HierarchyEventListener listener)
Add a
HierarchyEventListener event to the repository. |
void |
emitNoAppenderWarning(Category cat) |
Logger |
exists(String name) |
void |
fireAddAppenderEvent(Category logger,
Appender appender) |
Enumeration |
getCurrentCategories()
Deprecated.
|
Enumeration |
getCurrentLoggers() |
Logger |
getLogger(String name) |
Logger |
getLogger(String name,
LoggerFactory factory) |
Logger |
getRootLogger() |
Level |
getThreshold()
Get the repository-wide threshold.
|
boolean |
isDisabled(int level)
Returns whether this repository is disabled for a given
level.
|
void |
resetConfiguration() |
void |
setThreshold(Level level)
Set the repository-wide threshold.
|
void |
setThreshold(String val)
Another form of
setThreshold(Level) accepting a string
parameter instead of a Level . |
void |
shutdown() |
void addHierarchyEventListener(HierarchyEventListener listener)
HierarchyEventListener
event to the repository.listener
- The listenerboolean isDisabled(int level)
level
parameter. See also setThreshold(org.apache.log4j.Level)
method.level
- The levelvoid setThreshold(Level level)
Level.ALL
which has the lowest possible rank.level
- The levelvoid setThreshold(String val)
setThreshold(Level)
accepting a string
parameter instead of a Level
.val
- The threshold valuevoid emitNoAppenderWarning(Category cat)
Level getThreshold()
setThreshold(Level)
for an explanation.Logger getLogger(String name, LoggerFactory factory)
Logger getRootLogger()
void shutdown()
Enumeration getCurrentLoggers()
Enumeration getCurrentCategories()
getCurrentLoggers()
instead.void fireAddAppenderEvent(Category logger, Appender appender)
void resetConfiguration()
Copyright © 1999-2021 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.