Package org.apache.log4j.spi
Class NOPLoggerRepository
java.lang.Object
org.apache.log4j.spi.NOPLoggerRepository
- All Implemented Interfaces:
LoggerRepository
No-operation implementation of LoggerRepository which is used when
LogManager.repositorySelector is erroneously nulled during class reloading.
- Since:
- 1.2.15
-
Constructor Summary
Constructors -
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 ofLoggerRepository.setThreshold(Level)
accepting a string parameter instead of aLevel
.void
setThreshold
(Level level) Set the repository-wide threshold.void
shutdown()
-
Constructor Details
-
NOPLoggerRepository
public NOPLoggerRepository()
-
-
Method Details
-
addHierarchyEventListener
Add aHierarchyEventListener
event to the repository.- Specified by:
addHierarchyEventListener
in interfaceLoggerRepository
-
isDisabled
public 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 alsoLoggerRepository.setThreshold(org.apache.log4j.Level)
method.- Specified by:
isDisabled
in interfaceLoggerRepository
-
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.- Specified by:
setThreshold
in interfaceLoggerRepository
-
setThreshold
Another form ofLoggerRepository.setThreshold(Level)
accepting a string parameter instead of aLevel
.- Specified by:
setThreshold
in interfaceLoggerRepository
-
emitNoAppenderWarning
- Specified by:
emitNoAppenderWarning
in interfaceLoggerRepository
-
getThreshold
Get the repository-wide threshold. SeeLoggerRepository.setThreshold(Level)
for an explanation.- Specified by:
getThreshold
in interfaceLoggerRepository
-
getLogger
- Specified by:
getLogger
in interfaceLoggerRepository
-
getLogger
- Specified by:
getLogger
in interfaceLoggerRepository
-
getRootLogger
- Specified by:
getRootLogger
in interfaceLoggerRepository
-
exists
- Specified by:
exists
in interfaceLoggerRepository
-
shutdown
public void shutdown()- Specified by:
shutdown
in interfaceLoggerRepository
-
getCurrentLoggers
- Specified by:
getCurrentLoggers
in interfaceLoggerRepository
-
getCurrentCategories
Deprecated. Please useLoggerRepository.getCurrentLoggers()
instead.- Specified by:
getCurrentCategories
in interfaceLoggerRepository
-
fireAddAppenderEvent
- Specified by:
fireAddAppenderEvent
in interfaceLoggerRepository
-
resetConfiguration
public void resetConfiguration()- Specified by:
resetConfiguration
in interfaceLoggerRepository
-