|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.log.Hierarchy
This class encapsulates a basic independent log hierarchy. The hierarchy is essentially a safe wrapper around root logger.
| Nested Class Summary | |
private class |
Hierarchy.InnerErrorHandler |
private class |
Hierarchy.InnerLoggerListenerInner class to redirect to hierarchys real LoggerListener if any. |
| Field Summary | |
private static Hierarchy |
c_hierarchy |
static java.lang.String |
DEFAULT_FORMAT |
private ErrorHandler |
m_errorHandler |
private LoggerListener |
m_loggerListener |
private Logger |
m_rootLogger |
| Constructor Summary | |
Hierarchy()Create a hierarchy object. |
|
| Method Summary | |
void |
addLoggerListener(LoggerListener loggerListener)Set the LoggerListener associated with hierarchy. |
static Hierarchy |
getDefaultHierarchy()Retrieve the default hierarchy. |
Logger |
getLoggerFor(java.lang.String category)Retrieve a logger for named category. |
Logger |
getRootLogger()Utility method to retrieve logger for hierarchy. |
void |
log(java.lang.String message)Deprecated. Logging components should use ErrorHandler rather than Hierarchy.log() |
void |
log(java.lang.String message, java.lang.Throwable throwable)Deprecated. Logging components should use ErrorHandler rather than Hierarchy.log() |
private void |
notifyLoggerCreated(java.lang.String category, Logger logger)Notify logger listener (if any) that a new logger was created. |
void |
removeLoggerListener(LoggerListener loggerListener)Remove the LoggerListener associated with hierarchy. |
void |
setDefaultLogTarget(LogTarget target)Set the default log target for hierarchy. |
void |
setDefaultLogTargets(LogTarget[] targets)Set the default log targets for this hierarchy. |
void |
setDefaultPriority(Priority priority)Set the default priority for hierarchy. |
void |
setErrorHandler(ErrorHandler errorHandler)Set the ErrorHandler associated with hierarchy. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String DEFAULT_FORMAT
private static final Hierarchy c_hierarchy
private ErrorHandler m_errorHandler
private Logger m_rootLogger
private LoggerListener m_loggerListener
| Constructor Detail |
public Hierarchy()
| Method Detail |
public static Hierarchy getDefaultHierarchy()
In most cases the default LogHierarchy is the only one used in an application. However when security is a concern or multiple independent applications will be running in same JVM it is advantageous to create new Hierarchies rather than reuse default.
public void setDefaultLogTarget(LogTarget target)
target - the default targetpublic void setDefaultLogTargets(LogTarget[] targets)
targets - the default targetspublic void setDefaultPriority(Priority priority)
priority - the default prioritypublic void setErrorHandler(ErrorHandler errorHandler)
errorHandler - the ErrorHandlerpublic void addLoggerListener(LoggerListener loggerListener)
loggerListener - the LoggerListenerjava.lang.UnsupportedOperationException - if no more LoggerListeners are permitted.public void removeLoggerListener(LoggerListener loggerListener)
loggerListener - the LoggerListenerpublic Logger getLoggerFor(java.lang.String category)
category - the context
public void log(java.lang.String message,
java.lang.Throwable throwable)
message - a message to logthrowable - a Throwable to logpublic void log(java.lang.String message)
message - a message to log
private void notifyLoggerCreated(java.lang.String category,
Logger logger)
category - the category of new loggerlogger - the loggerpublic final Logger getRootLogger()
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||