## org.apache.log4j.spi
Interface LoggerRepository

All Known Implementing Classes:
  Hierarchy, NOPLoggerRepository

    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
`void` `addHierarchyEventListener(HierarchyEventListener listener)` Add a `HierarchyEventListener` event to the repository.
`void` `emitNoAppenderWarning(Category cat)`
`Logger` `exists(java.lang.String name)`
`void` `fireAddAppenderEvent(Category logger, Appender appender)`
`java.util.Enumeration` `getCurrentCategories()` Deprecated.
`java.util.Enumeration` `getCurrentLoggers()`
`Logger` `getLogger(java.lang.String name)`
`Logger` `getLogger(java.lang.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(java.lang.String val)` Another form of `setThreshold(Level)` accepting a string parameter instead of a `Level`.
`void` `shutdown()`

Method Detail

### addHierarchyEventListener

    void addHierarchyEventListener(HierarchyEventListener listener)

  Add a `HierarchyEventListener` event to the repository.

### isDisabled

    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(org.apache.log4j.Level)` method.

### setThreshold

    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

    void setThreshold(java.lang.String val)

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

### emitNoAppenderWarning

    void emitNoAppenderWarning(Category cat)

### getThreshold

    Level getThreshold()

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

### getLogger

    Logger getLogger(java.lang.String name)

### getLogger

    Logger getLogger(java.lang.String name,
                     LoggerFactory factory)

### getRootLogger

    Logger getRootLogger()

### exists

    Logger exists(java.lang.String name)

### shutdown

    void shutdown()

### getCurrentLoggers

    java.util.Enumeration getCurrentLoggers()

### getCurrentCategories

    java.util.Enumeration getCurrentCategories()

  Deprecated. Please use `getCurrentLoggers()` instead.

### fireAddAppenderEvent

    void fireAddAppenderEvent(Category logger,
                              Appender appender)

### resetConfiguration

    void resetConfiguration()

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