org.apache.log
public class Hierarchy extends Object
Nested Class Summary | |
---|---|
class | Hierarchy.InnerErrorHandler |
class | Hierarchy.InnerLoggerListener
Inner class to redirect to hierarchys real LoggerListener if any.
|
Field Summary | |
---|---|
static Hierarchy | c_hierarchy |
static String | DEFAULT_FORMAT |
ErrorHandler | m_errorHandler |
LoggerListener | m_loggerListener |
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(String category)
Retrieve a logger for named category.
|
Logger | getRootLogger()
Utility method to retrieve logger for hierarchy.
|
void | notifyLoggerCreated(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.
|
Parameters: loggerListener the LoggerListener
Throws: UnsupportedOperationException if no more LoggerListeners are permitted.
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.
Returns: the default Hierarchy
Parameters: category the context
Returns: the Logger
Returns: the Logger
Parameters: category the category of new logger logger the logger
Parameters: loggerListener the LoggerListener
Parameters: target the default target
Parameters: targets the default targets
Parameters: priority the default priority
Parameters: errorHandler the ErrorHandler