org.apache.log4j.spi

Interface LoggerRepository

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

Author: Ceki Gülcü

Method Summary
voidaddHierarchyEventListener(HierarchyEventListener listener)
Add a HierarchyEventListener event to the repository.
voidemitNoAppenderWarning(Category cat)
abstract Loggerexists(String name)
abstract 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.
abstract voidresetConfiguration()
voidsetThreshold(Level level)
Set the repository-wide threshold.
voidsetThreshold(String val)
Another form of setThreshold accepting a string parameter instead of a Level.
abstract voidshutdown()

Method Detail

addHierarchyEventListener

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

emitNoAppenderWarning

public void emitNoAppenderWarning(Category cat)

exists

public abstract Logger exists(String name)

fireAddAppenderEvent

public abstract void fireAddAppenderEvent(Category logger, Appender appender)

getCurrentCategories

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

getCurrentLoggers

public Enumeration getCurrentLoggers()

getLogger

public Logger getLogger(String name)

getLogger

public Logger getLogger(String name, LoggerFactory factory)

getRootLogger

public Logger getRootLogger()

getThreshold

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

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 method.

resetConfiguration

public abstract void resetConfiguration()

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.

setThreshold

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

shutdown

public abstract void shutdown()
Copyright 2000-2005 Apache Software Foundation.