|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jlog2.LoggerHandler
public class LoggerHandler
This class handles logging operations.
Field Summary | |
---|---|
static java.lang.String |
ALL
Indicates all logging levels |
static java.lang.String |
ERROR
The error log level |
static java.lang.String |
INFO
The info log level |
protected static LoggerFactory |
loggerFactory
The factory that generates the loggers |
static java.lang.String |
MESSAGE
The message log level - always output to stdout and any others |
static java.lang.String |
SEVERE
The severe log level |
static java.lang.Object |
syncOn
An object to synchronize on |
static java.lang.String |
WARN
The warn log level |
Constructor Summary | |
---|---|
LoggerHandler()
Creates a new instance of LoggerHandler. |
|
LoggerHandler(LoggerFactory theLoggerFactory)
Creates a new instance of LoggerHandler. |
Method Summary | |
---|---|
static void |
addDefaultDebugChannels(java.util.Vector theLogChannels)
Add default channels to write the debug messages to. |
static void |
addDefaultLogChannels(java.util.Vector theLogChannels)
Add default channels to write the log messages to. |
static void |
debugError(Logger logger,
java.lang.String level,
java.lang.Exception error)
Log the error on the debug log stream. |
static void |
debugMessage(Logger logger,
java.lang.String level,
java.lang.String methodName,
java.lang.String message)
Log the message on the debug stream if suitable. |
static Logger |
getLogger(java.lang.String loggerID)
Return a logger appropriate to the class specified. |
static boolean |
levelOK(java.lang.String theLevel,
java.lang.String logLevel)
Return true if the level to log at is higher or equal to the configuration level. |
static void |
logError(Logger logger,
java.lang.String level,
java.lang.Exception error)
Log the error on the log stream. |
static void |
logMessage(Logger logger,
java.lang.String level,
java.lang.String methodName,
java.lang.String message)
Log the message on the logger if suitable. |
static void |
setUserLoggerFactory(LoggerFactory userLoggerFactory)
Set the user logger factory to control the logging channels. |
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 ALL
public static final java.lang.String INFO
public static final java.lang.String WARN
public static final java.lang.String ERROR
public static final java.lang.String SEVERE
public static final java.lang.String MESSAGE
public static final java.lang.Object syncOn
protected static LoggerFactory loggerFactory
Constructor Detail |
---|
public LoggerHandler() throws java.lang.Exception
java.lang.Exception
- any error.public LoggerHandler(LoggerFactory theLoggerFactory) throws java.lang.Exception
theLoggerFactory
- this can be a new logger factory you have written
to override the operation of the default CustomLoggerFactory.
java.lang.Exception
- any error.Method Detail |
---|
public static void setUserLoggerFactory(LoggerFactory userLoggerFactory)
userLoggerFactory
- the factory to generate new loggers with.public static Logger getLogger(java.lang.String loggerID)
loggerID
- the id used to identify the logger.
public static void addDefaultLogChannels(java.util.Vector theLogChannels)
theLogChannels
- the channels to write the log messages to.public static void addDefaultDebugChannels(java.util.Vector theLogChannels)
theLogChannels
- the channels to write the debug messages to.public static boolean levelOK(java.lang.String theLevel, java.lang.String logLevel)
theLevel
- the level the error or log message is at.logLevel
- the level the configuration is set to log to.
public static void logMessage(Logger logger, java.lang.String level, java.lang.String methodName, java.lang.String message)
logger
- the logger to write to.level
- the error level.methodName
- the name of the method in the class throwing the exception.message
- the message to log.public static void debugMessage(Logger logger, java.lang.String level, java.lang.String methodName, java.lang.String message)
logger
- the logger to write to.level
- the error level.methodName
- the name of the method in the class throwing the exception.message
- the message to log.public static void logError(Logger logger, java.lang.String level, java.lang.Exception error)
logger
- the logger to write to.level
- the error level.error
- the error to log.public static void debugError(Logger logger, java.lang.String level, java.lang.Exception error)
logger
- the logger to write to.level
- the error level.error
- the error to log.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |