Package org.apache.log4j.spi
Class NOPLoggerRepository
- java.lang.Object
-
- org.apache.log4j.spi.NOPLoggerRepository
-
- All Implemented Interfaces:
LoggerRepository
public final class NOPLoggerRepository extends java.lang.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(java.lang.String name)voidfireAddAppenderEvent(Category logger, Appender appender)java.util.EnumerationgetCurrentCategories()Deprecated.java.util.EnumerationgetCurrentLoggers()LoggergetLogger(java.lang.String name)LoggergetLogger(java.lang.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(java.lang.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- Parameters:
listener- The listener
-
emitNoAppenderWarning
public void emitNoAppenderWarning(Category cat)
- Specified by:
emitNoAppenderWarningin interfaceLoggerRepository
-
exists
public Logger exists(java.lang.String name)
- Specified by:
existsin interfaceLoggerRepository
-
fireAddAppenderEvent
public void fireAddAppenderEvent(Category logger, Appender appender)
- Specified by:
fireAddAppenderEventin interfaceLoggerRepository
-
getCurrentCategories
public java.util.Enumeration getCurrentCategories()
Deprecated. Please useLoggerRepository.getCurrentLoggers()instead.- Specified by:
getCurrentCategoriesin interfaceLoggerRepository- Returns:
- an enumeration of loggers.
-
getCurrentLoggers
public java.util.Enumeration getCurrentLoggers()
- Specified by:
getCurrentLoggersin interfaceLoggerRepository
-
getLogger
public Logger getLogger(java.lang.String name)
- Specified by:
getLoggerin interfaceLoggerRepository
-
getLogger
public Logger getLogger(java.lang.String name, LoggerFactory factory)
- Specified by:
getLoggerin interfaceLoggerRepository
-
getRootLogger
public Logger getRootLogger()
- Specified by:
getRootLoggerin interfaceLoggerRepository
-
getThreshold
public Level getThreshold()
Get the repository-wide threshold. SeeLoggerRepository.setThreshold(Level)for an explanation.- Specified by:
getThresholdin interfaceLoggerRepository- Returns:
- the level.
-
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- Parameters:
level- The level- Returns:
- whether this repository is disabled.
-
resetConfiguration
public void resetConfiguration()
- Specified by:
resetConfigurationin 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- Parameters:
level- The level
-
setThreshold
public void setThreshold(java.lang.String val)
Another form ofLoggerRepository.setThreshold(Level)accepting a string parameter instead of aLevel.- Specified by:
setThresholdin interfaceLoggerRepository- Parameters:
val- The threshold value
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceLoggerRepository
-
-