public interface

LoggerRepository

org.apache.log4j.spi.LoggerRepository
Known Indirect Subclasses

Class Overview

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.

Summary

Public Methods
abstract void addHierarchyEventListener(HierarchyEventListener listener)
Add a HierarchyEventListener event to the repository.
abstract void emitNoAppenderWarning(Category cat)
abstract Logger exists(String name)
abstract void fireAddAppenderEvent(Category logger, Appender appender)
abstract Enumeration getCurrentCategories()
Deprecated.
abstract Enumeration getCurrentLoggers()
abstract Logger getLogger(String name)
abstract Logger getLogger(String name, LoggerFactory factory)
abstract Logger getRootLogger()
abstract Level getThreshold()
Get the repository-wide threshold.
abstract boolean isDisabled(int level)
Returns whether this repository is disabled for a given level.
abstract void resetConfiguration()
abstract void setThreshold(String val)
Another form of setThreshold(Level) accepting a string parameter instead of a Level.
abstract void setThreshold(Level level)
Set the repository-wide threshold.
abstract void shutdown()

Public Methods

public abstract void addHierarchyEventListener (HierarchyEventListener listener)

Add a HierarchyEventListener event to the repository.

public abstract void emitNoAppenderWarning (Category cat)

public abstract Logger exists (String name)

public abstract void fireAddAppenderEvent (Category logger, Appender appender)

public abstract Enumeration getCurrentCategories ()

Deprecated. Please use getCurrentLoggers() instead.

public abstract Enumeration getCurrentLoggers ()

public abstract Logger getLogger (String name)

public abstract Logger getLogger (String name, LoggerFactory factory)

public abstract Logger getRootLogger ()

public abstract Level getThreshold ()

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

public abstract 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 setThreshold(String) method.

public abstract void resetConfiguration ()

public abstract void setThreshold (String val)

Another form of setThreshold(Level) accepting a string parameter instead of a Level.

public abstract 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.

public abstract void shutdown ()