org.apache.log4j.spi
Class NOPLoggerRepository

java.lang.Object
  extended by 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
NOPLoggerRepository()
           
 
Method Summary
 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 LoggerRepository.setThreshold(Level) accepting a string parameter instead of a Level.
 void shutdown()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NOPLoggerRepository

public NOPLoggerRepository()
Method Detail

addHierarchyEventListener

public void addHierarchyEventListener(HierarchyEventListener listener)
Add a HierarchyEventListener event to the repository.

Specified by:
addHierarchyEventListener in interface LoggerRepository

isDisabled

public boolean isDisabled(int level)
Returns whether this repository is disabled for a given level. The answer depends on the repository threshold and the level parameter. See also LoggerRepository.setThreshold(org.apache.log4j.Level) method.

Specified by:
isDisabled in interface LoggerRepository

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 to Level.ALL which has the lowest possible rank.

Specified by:
setThreshold in interface LoggerRepository

setThreshold

public void setThreshold(String val)
Another form of LoggerRepository.setThreshold(Level) accepting a string parameter instead of a Level.

Specified by:
setThreshold in interface LoggerRepository

emitNoAppenderWarning

public void emitNoAppenderWarning(Category cat)

Specified by:
emitNoAppenderWarning in interface LoggerRepository

getThreshold

public Level getThreshold()
Get the repository-wide threshold. See LoggerRepository.setThreshold(Level) for an explanation.

Specified by:
getThreshold in interface LoggerRepository

getLogger

public Logger getLogger(String name)

Specified by:
getLogger in interface LoggerRepository

getLogger

public Logger getLogger(String name,
                        LoggerFactory factory)

Specified by:
getLogger in interface LoggerRepository

getRootLogger

public Logger getRootLogger()

Specified by:
getRootLogger in interface LoggerRepository

exists

public Logger exists(String name)

Specified by:
exists in interface LoggerRepository

shutdown

public void shutdown()

Specified by:
shutdown in interface LoggerRepository

getCurrentLoggers

public Enumeration getCurrentLoggers()

Specified by:
getCurrentLoggers in interface LoggerRepository

getCurrentCategories

public Enumeration getCurrentCategories()
Deprecated. Please use LoggerRepository.getCurrentLoggers() instead.

Specified by:
getCurrentCategories in interface LoggerRepository

fireAddAppenderEvent

public void fireAddAppenderEvent(Category logger,
                                 Appender appender)

Specified by:
fireAddAppenderEvent in interface LoggerRepository

resetConfiguration

public void resetConfiguration()

Specified by:
resetConfiguration in interface LoggerRepository


Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved.