|
Log4j 1.3alpha-1 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Method Summary | |
void |
addErrorItem(ErrorItem errorItem)
Errors which cannot be logged, go to the error list, |
void |
addLoggerEventListener(LoggerEventListener listener)
Add a LoggerEventListener to the repository. |
void |
addLoggerRepositoryEventListener(LoggerRepositoryEventListener listener)
Add a LoggerRepositoryEventListener to the repository. |
void |
emitNoAppenderWarning(Logger logger)
|
Logger |
exists(java.lang.String name)
|
void |
fireAddAppenderEvent(Logger logger,
Appender appender)
Requests that a appender added event be sent to any registered LoggerEventListener . |
void |
fireConfigurationChangedEvent()
Requests that a configuration changed event be sent to any registered LoggerRepositoryEventListener . |
void |
fireLevelChangedEvent(Logger logger)
Requests that a level changed event be sent to any registered LoggerEventListener . |
void |
fireRemoveAppenderEvent(Logger logger,
Appender appender)
Requests that a appender removed event be sent to any registered LoggerEventListener . |
java.util.Enumeration |
getCurrentCategories()
Deprecated. Please use getCurrentLoggers() instead. |
java.util.Enumeration |
getCurrentLoggers()
|
java.util.List |
getErrorList()
Errors which cannot be logged, go to the error list, |
Logger |
getLogger(java.lang.String name)
|
Logger |
getLogger(java.lang.String name,
LoggerFactory factory)
|
java.lang.String |
getName()
Get the name of this logger repository. |
PluginRegistry |
getPluginRegistry()
Return the PluginRegisty for this LoggerRepository. |
java.util.Map |
getProperties()
Get the properties specific for this repository. |
java.lang.String |
getProperty(java.lang.String key)
Get the property of this repository. |
Logger |
getRootLogger()
|
Level |
getThreshold()
Get the repository-wide threshold. |
boolean |
isDisabled(int level)
Is the repository disabled for a given level? |
boolean |
isPristine()
Is the current configuration of the reposiroty in its original (pristine) state? |
void |
removeLoggerEventListener(LoggerEventListener listener)
Remove a LoggerEventListener from the repository. |
void |
removeLoggerRepositoryEventListener(LoggerRepositoryEventListener listener)
Remove a LoggerRepositoryEventListener from the repository. |
void |
resetConfiguration()
|
void |
setName(java.lang.String repoName)
A logger repository is a named entity. |
void |
setPristine(boolean state)
Set the pristine flag. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Set a property of this repository. |
void |
setThreshold(Level level)
Deprecated. Will be removed with no replacement. |
void |
setThreshold(java.lang.String val)
Another form of setThreshold(Level) accepting a string
parameter instead of a Level . |
void |
shutdown()
|
Method Detail |
public void addLoggerRepositoryEventListener(LoggerRepositoryEventListener listener)
LoggerRepositoryEventListener
to the repository. The
listener will be called when repository events occur.
public void removeLoggerRepositoryEventListener(LoggerRepositoryEventListener listener)
LoggerRepositoryEventListener
from the repository.
public void addLoggerEventListener(LoggerEventListener listener)
LoggerEventListener
to the repository. The listener
will be called when repository events occur.
public void removeLoggerEventListener(LoggerEventListener listener)
LoggerEventListener
from the repository.
public boolean isDisabled(int level)
level
parameter. See also setThreshold(org.apache.log4j.Level)
method.
public java.lang.String getName()
public void setName(java.lang.String repoName)
public void setThreshold(Level level)
Level.ALL
which has the lowest possible rank.
The repository-wide threshold acts as a global on off switch. It avoids the hierarchy walk, hence improving performance. In future log4j versions the speed of the hiearchy walk will be significantly improved obliviating the need for this method.
The repository-wide threshold is a deprecated feature.
public void setThreshold(java.lang.String val)
setThreshold(Level)
accepting a string
parameter instead of a Level
.
public void emitNoAppenderWarning(Logger logger)
public Level getThreshold()
setThreshold(Level)
for an explanation.
public Logger getLogger(java.lang.String name)
public Logger getLogger(java.lang.String name, LoggerFactory factory)
public Logger getRootLogger()
public boolean isPristine()
public void setPristine(boolean state)
isPristine()
public Logger exists(java.lang.String name)
public void shutdown()
public java.util.Enumeration getCurrentLoggers()
public java.util.Enumeration getCurrentCategories()
getCurrentLoggers()
instead.
public void resetConfiguration()
public void fireAddAppenderEvent(Logger logger, Appender appender)
LoggerEventListener
.
logger
- The logger to which the appender was added.appender
- The appender added to the logger.public void fireRemoveAppenderEvent(Logger logger, Appender appender)
LoggerEventListener
.
logger
- The logger from which the appender was removed.appender
- The appender removed from the logger.public void fireLevelChangedEvent(Logger logger)
LoggerEventListener
.
logger
- The logger which changed levels.public void fireConfigurationChangedEvent()
LoggerRepositoryEventListener
.
public PluginRegistry getPluginRegistry()
public java.util.Map getProperties()
public java.lang.String getProperty(java.lang.String key)
public void setProperty(java.lang.String key, java.lang.String value)
public java.util.List getErrorList()
public void addErrorItem(ErrorItem errorItem)
|
Log4j 1.3alpha-1 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |