Package org.apache.log4j.spi
Class NOPLoggerRepository
- java.lang.Object
-
- org.apache.log4j.spi.NOPLoggerRepository
-
- All Implemented Interfaces:
LoggerRepository
public final class NOPLoggerRepository extends Object implements 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 Constructor Description NOPLoggerRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHierarchyEventListener(HierarchyEventListener listener)Add aHierarchyEventListenerevent to the repository.voidemitNoAppenderWarning(Category cat)Loggerexists(String name)voidfireAddAppenderEvent(Category logger, Appender appender)EnumerationgetCurrentCategories()Deprecated.EnumerationgetCurrentLoggers()LoggergetLogger(String name)LoggergetLogger(String name, LoggerFactory factory)LoggergetRootLogger()LevelgetThreshold()Get the repository-wide threshold.booleanisDisabled(int level)Returns whether this repository is disabled for a given level.voidresetConfiguration()voidsetThreshold(String val)Another form ofLoggerRepository.setThreshold(Level)accepting a string parameter instead of aLevel.voidsetThreshold(Level level)Set the repository-wide threshold.voidshutdown()
-
-
-
Method Detail
-
addHierarchyEventListener
public void addHierarchyEventListener(HierarchyEventListener listener)
Add aHierarchyEventListenerevent to the repository.- Specified by:
addHierarchyEventListenerin 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 thelevelparameter. See alsoLoggerRepository.setThreshold(org.apache.log4j.Level)method.- Specified by:
isDisabledin interfaceLoggerRepository
-
setThreshold
public void setThreshold(Level level)
Set the repository-wide threshold. All logging requests below the threshold are immediately dropped. By default, the threshold is set toLevel.ALLwhich has the lowest possible rank.- Specified by:
setThresholdin interfaceLoggerRepository
-
setThreshold
public void setThreshold(String val)
Another form ofLoggerRepository.setThreshold(Level)accepting a string parameter instead of aLevel.- Specified by:
setThresholdin interfaceLoggerRepository
-
emitNoAppenderWarning
public void emitNoAppenderWarning(Category cat)
- Specified by:
emitNoAppenderWarningin interfaceLoggerRepository
-
getThreshold
public Level getThreshold()
Get the repository-wide threshold. SeeLoggerRepository.setThreshold(Level)for an explanation.- Specified by:
getThresholdin interfaceLoggerRepository
-
getLogger
public Logger getLogger(String name)
- Specified by:
getLoggerin interfaceLoggerRepository
-
getLogger
public Logger getLogger(String name, LoggerFactory factory)
- Specified by:
getLoggerin interfaceLoggerRepository
-
getRootLogger
public Logger getRootLogger()
- Specified by:
getRootLoggerin interfaceLoggerRepository
-
exists
public Logger exists(String name)
- Specified by:
existsin interfaceLoggerRepository
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceLoggerRepository
-
getCurrentLoggers
public Enumeration getCurrentLoggers()
- Specified by:
getCurrentLoggersin interfaceLoggerRepository
-
getCurrentCategories
public Enumeration getCurrentCategories()
Deprecated. Please useLoggerRepository.getCurrentLoggers()instead.- Specified by:
getCurrentCategoriesin interfaceLoggerRepository
-
fireAddAppenderEvent
public void fireAddAppenderEvent(Category logger, Appender appender)
- Specified by:
fireAddAppenderEventin interfaceLoggerRepository
-
resetConfiguration
public void resetConfiguration()
- Specified by:
resetConfigurationin interfaceLoggerRepository
-
-