|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.log.Hierarchy
This class encapsulates a basic independent log hierarchy. The hierarchy is essentially a safe wrapper around root logger.
Constructor Summary | |
Hierarchy()
Create a hierarchy object. |
Method Summary | |
static Hierarchy |
getDefaultHierarchy()
Retrieve the default hierarchy. |
Logger |
getLoggerFor(String category)
Retrieve a logger for named category. |
protected Logger |
getRootLogger()
Utility method to retrieve logger for hierarchy. |
void |
log(String message)
Deprecated. Logging components should use ErrorHandler rather than Hierarchy.log() |
void |
log(String message,
Throwable throwable)
Deprecated. Logging components should use ErrorHandler rather than Hierarchy.log() |
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 |
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 Logger getLoggerFor(String category)
category
- the contextpublic void log(String message, Throwable throwable)
message
- a message to logthrowable
- a Throwable to logpublic void log(String message)
message
- a message to logprotected final Logger getRootLogger()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |