Package org.apache.log4j.spi
Interface LoggerRepository
- All Known Implementing Classes:
Hierarchy
,NOPLoggerRepository
public interface LoggerRepository
A
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.
- Since:
- 1.2
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add aHierarchyEventListener
event to the repository.void
void
fireAddAppenderEvent
(Category logger, Appender appender) Deprecated.getLogger
(String name, LoggerFactory factory) Get the repository-wide threshold.boolean
isDisabled
(int level) Returns whether this repository is disabled for a given level.void
void
setThreshold
(String val) Another form ofsetThreshold(Level)
accepting a string parameter instead of aLevel
.void
setThreshold
(Level level) Set the repository-wide threshold.void
shutdown()
-
Method Details
-
addHierarchyEventListener
Add aHierarchyEventListener
event to the repository.- Parameters:
listener
- The listener
-
isDisabled
boolean isDisabled(int level) Returns whether this repository is disabled for a given level. The answer depends on the repository threshold and thelevel
parameter. See alsosetThreshold(org.apache.log4j.Level)
method.- Parameters:
level
- The level- Returns:
- whether this repository is disabled.
-
setThreshold
Set the repository-wide threshold. All logging requests below the threshold are immediately dropped. By default, the threshold is set toLevel.ALL
which has the lowest possible rank.- Parameters:
level
- The level
-
setThreshold
Another form ofsetThreshold(Level)
accepting a string parameter instead of aLevel
.- Parameters:
val
- The threshold value
-
emitNoAppenderWarning
-
getThreshold
Level getThreshold()Get the repository-wide threshold. SeesetThreshold(Level)
for an explanation.- Returns:
- the level.
-
getLogger
-
getLogger
-
getRootLogger
Logger getRootLogger() -
exists
-
shutdown
void shutdown() -
getCurrentLoggers
Enumeration getCurrentLoggers() -
getCurrentCategories
Enumeration getCurrentCategories()Deprecated. Please usegetCurrentLoggers()
instead.- Returns:
- an enumeration of loggers.
-
fireAddAppenderEvent
-
resetConfiguration
void resetConfiguration()
-