Package wt.log4j
Interface Logger
public interface Logger
This is the central interface in the log4j package. Most logging operations are done through this interface.
Supported API: true
Extendable: false
The canonical way to obtain a Logger for a class is through LogManager.getLogger(). Typically, each class
gets its own Logger named after its fully qualified class name (the default Logger name when obtained through the
LogManager.getLogger() method). Thus, the simplest way to use this would be like so:
public class MyClass {
private static final Logger LOGGER = LogManager.getLogger();
// ...
}
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionvoidLogs a message object with theDEBUGlevel.voidLogs a message at theDEBUGlevel including the stack trace of theThrowablethrowablepassed as parameter.voidLogs a message object with theDEBUGlevel.voidLogs a message with parameters at theDEBUGlevel.voidLogs a message at theDEBUGlevel including the stack trace of theThrowablethrowablepassed as parameter.voidLogs a message object with theERRORlevel.voidLogs a message at theERRORlevel including the stack trace of theThrowablethrowablepassed as parameter.voidLogs a message object with theERRORlevel.voidLogs a message with parameters at theERRORlevel.voidLogs a message at theERRORlevel including the stack trace of theThrowablethrowablepassed as parameter.voidLogs a message object with theFATALlevel.voidLogs a message at theFATALlevel including the stack trace of theThrowablethrowablepassed as parameter.voidLogs a message object with theFATALlevel.voidLogs a message with parameters at theFATALlevel.voidLogs a message at theFATALlevel including the stack trace of theThrowablethrowablepassed as parameter.voidLogs a message object with theINFOlevel.voidLogs a message at theINFOlevel including the stack trace of theThrowablethrowablepassed as parameter.voidLogs a message object with theINFOlevel.voidLogs a message with parameters at theINFOlevel.voidLogs a message at theINFOlevel including the stack trace of theThrowablethrowablepassed as parameter.booleanChecks whether this Logger is enabled for theDEBUGLevel.booleanChecks whether this Logger is enabled for theERRORLevel.booleanChecks whether this Logger is enabled for theFATALLevel.booleanChecks whether this Logger is enabled for theINFOLevel.booleanChecks whether this Logger is enabled for theTRACElevel.booleanChecks whether this Logger is enabled for theWARNLevel.voidLogs a message object with theTRACElevel.voidLogs a message at theTRACElevel including the stack trace of theThrowablethrowablepassed as parameter.voidLogs a message object with theTRACElevel.voidLogs a message with parameters at theTRACElevel.voidLogs a message at theTRACElevel including the stack trace of theThrowablethrowablepassed as parameter.voidLogs a message object with theWARNlevel.voidLogs a message at theWARNlevel including the stack trace of theThrowablethrowablepassed as parameter.voidLogs a message object with theWARNlevel.voidLogs a message with parameters at theWARNlevel.voidLogs a message at theWARNlevel including the stack trace of theThrowablethrowablepassed as parameter.
-
Method Details
-
isInfoEnabled
boolean isInfoEnabled()Checks whether this Logger is enabled for theINFOLevel.
Supported API: true
Extendable: false- Returns:
- boolean -
trueif this Logger is enabled for level INFO,falseotherwise.
-
info
Logs a message object with theINFOlevel.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.
-
info
Logs a message at theINFOlevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.throwable- theThrowableto log, including its stack trace.
-
info
Logs a message object with theINFOlevel.
Supported API: true
Extendable: false- Parameters:
message- the message string to log.
-
info
Logs a message at theINFOlevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.throwable- theThrowableto log, including its stack trace.
-
info
Logs a message with parameters at theINFOlevel.
Supported API: true
Extendable: false- Parameters:
message- the message to log; the format depends on the message factory.params- parameters to the message.- See Also:
-
#getMessageFactory()
-
isDebugEnabled
boolean isDebugEnabled()Checks whether this Logger is enabled for theDEBUGLevel.
Supported API: true
Extendable: false- Returns:
- boolean -
trueif this Logger is enabled for level DEBUG,falseotherwise.
-
debug
Logs a message object with theDEBUGlevel.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.
-
debug
Logs a message at theDEBUGlevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message to log.throwable- theThrowableto log, including its stack trace.
-
debug
Logs a message object with theDEBUGlevel.
Supported API: true
Extendable: false- Parameters:
message- the message string to log.
-
debug
Logs a message at theDEBUGlevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message to log.throwable- theThrowableto log, including its stack trace.
-
debug
Logs a message with parameters at theDEBUGlevel.
Supported API: true
Extendable: false- Parameters:
message- the message to log; the format depends on the message factory.params- parameters to the message.- See Also:
-
#getMessageFactory()
-
isErrorEnabled
boolean isErrorEnabled()Checks whether this Logger is enabled for theERRORLevel.
Supported API: true
Extendable: false- Returns:
- boolean -
trueif this Logger is enabled for levelERROR,falseotherwise.
-
error
Logs a message object with theERRORlevel.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.
-
error
Logs a message at theERRORlevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.throwable- theThrowableto log, including its stack trace.
-
error
Logs a message object with theERRORlevel.
Supported API: true
Extendable: false- Parameters:
message- the message string to log.
-
error
Logs a message at theERRORlevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.throwable- theThrowableto log, including its stack trace.
-
error
Logs a message with parameters at theERRORlevel.
Supported API: true
Extendable: false- Parameters:
message- the message to log; the format depends on the message factory.params- parameters to the message.- See Also:
-
#getMessageFactory()
-
isFatalEnabled
boolean isFatalEnabled()Checks whether this Logger is enabled for theFATALLevel.
Supported API: true
Extendable: false- Returns:
- boolean -
trueif this Logger is enabled for levelFATAL,falseotherwise.
-
fatal
Logs a message object with theFATALlevel.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.
-
fatal
Logs a message at theFATALlevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.throwable- theThrowableto log, including its stack trace.
-
fatal
Logs a message object with theFATALlevel.
Supported API: true
Extendable: false- Parameters:
message- the message string to log.
-
fatal
Logs a message at theFATALlevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.throwable- theThrowableto log, including its stack trace.
-
fatal
Logs a message with parameters at theFATALlevel.
Supported API: true
Extendable: false- Parameters:
message- the message to log; the format depends on the message factory.params- parameters to the message.- See Also:
-
#getMessageFactory()
-
isTraceEnabled
boolean isTraceEnabled()Checks whether this Logger is enabled for theTRACElevel.
Supported API: true
Extendable: false- Returns:
- boolean -
trueif this Logger is enabled for level TRACE,falseotherwise.
-
trace
Logs a message object with theTRACElevel.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.
-
trace
Logs a message at theTRACElevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.throwable- theThrowableto log, including its stack trace.- See Also:
-
trace
Logs a message object with theTRACElevel.
Supported API: true
Extendable: false- Parameters:
message- the message string to log.
-
trace
Logs a message at theTRACElevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.throwable- theThrowableto log, including its stack trace.- See Also:
-
trace
Logs a message with parameters at theTRACElevel.
Supported API: true
Extendable: false- Parameters:
message- the message to log; the format depends on the message factory.params- parameters to the message.- See Also:
-
#getMessageFactory()
-
isWarnEnabled
boolean isWarnEnabled()Checks whether this Logger is enabled for theWARNLevel.
Supported API: true
Extendable: false- Returns:
- boolean -
trueif this Logger is enabled for levelWARN,falseotherwise.
-
warn
Logs a message object with theWARNlevel.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.
-
warn
Logs a message at theWARNlevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.throwable- theThrowableto log, including its stack trace.
-
warn
Logs a message object with theWARNlevel.
Supported API: true
Extendable: false- Parameters:
message- the message string to log.
-
warn
Logs a message at theWARNlevel including the stack trace of theThrowablethrowablepassed as parameter.
Supported API: true
Extendable: false- Parameters:
message- the message object to log.throwable- theThrowableto log, including its stack trace.
-
warn
Logs a message with parameters at theWARNlevel.
Supported API: true
Extendable: false- Parameters:
message- the message to log; the format depends on the message factory.params- parameters to the message.- See Also:
-
#getMessageFactory()
-