public class Hierarchy extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FORMAT |
Constructor and Description |
---|
Hierarchy()
Create a hierarchy object.
|
Modifier and Type | Method and Description |
---|---|
void |
addLoggerListener(LoggerListener loggerListener)
Set the LoggerListener associated with hierarchy.
|
static Hierarchy |
getDefaultHierarchy()
Retrieve the default hierarchy.
|
Logger |
getLoggerFor(String category)
Retrieve a logger for named category.
|
Logger |
getRootLogger()
Utility method to retrieve logger for hierarchy.
|
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.
|
public static final String DEFAULT_FORMAT
public Hierarchy()
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 LoggerListenerUnsupportedOperationException
- if no more LoggerListeners are
permitted.public void removeLoggerListener(LoggerListener loggerListener)
loggerListener
- the LoggerListenerpublic Logger getLoggerFor(String category)
category
- the contextpublic final Logger getRootLogger()
Copyright © 1997–2020. All rights reserved.