Class ODataLogger
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionvoidLog a message object with thelevel.invalid reference
DEBUGvoidLog a message object with theDEBUGlevel including the stack trace of theThrowabletpassed as parameter.voidLog debug messages.voidLog debug messages.voidLog a message object with theLevel.invalid reference
ERRORvoidLog a message object with theERRORlevel including the stack trace of theThrowabletpassed as parameter.voidLog a message object with theLevel.invalid reference
FATALvoidLog a message object with theFATALlevel including the stack trace of theThrowabletpassed as parameter.final ObjectgetLevel()Returns the assigned, if any, for this Category.invalid reference
Levelstatic ODataLoggerShorthand forgetLogger(clazz.getName()).static ODataLoggerRetrieve a logger named according to the value of thenameparameter.voidLog a message object with theLevel.invalid reference
INFOvoidLog a message object with theINFOlevel including the stack trace of theThrowabletpassed as parameter.booleanCheck whether this category is enabled for theDEBUGLevel.booleanCheck whether this category is enabled for the info Level.booleanCheck whether this category is enabled for the TRACE Level.voidLog a message object with theTRACElevel including the stack trace of theThrowabletpassed as parameter.voidLog trace messages.voidLog a message object with theLevel.invalid reference
WARNvoid
-
Method Details
-
getLogger
Retrieve a logger named according to the value of thenameparameter. If the named logger already exists, then the existing instance will be returned. Otherwise, a new instance is created.By default, loggers do not have a set level but inherit it from their neareast ancestor with a set level. This is one of the central features of log4j.
Supported API: true- Parameters:
name- The name of the logger to retrieve.
-
getLogger
Shorthand forgetLogger(clazz.getName()).
Supported API: true- Parameters:
clazz- The name ofclazzwill be used as the name of the logger to retrieve. SeegetLogger(String)for more detailed information.
-
getLevel
Returns the assigned, if any, for this Category.invalid reference
Level
Supported API: true- Returns:
- Level - the assigned Level, can be
null.
-
error
Log a message object with theERRORlevel including the stack trace of theThrowabletpassed as parameter.See
error(Object)form for more detailed information.
Supported API: true- Parameters:
message- the message object to log.t- the exception to log, including its stack trace.
-
error
Log a message object with theLevel.invalid reference
ERRORThis method first checks if this category is
ERRORenabled by comparing the level of this category withLevel. If this category isinvalid reference
ERRORERRORenabled, then it converts the message object passed as parameter to a string. It proceeds to call all the registered appenders in this category and also higher in the hierarchy depending on the value of the additivity flag.WARNING Note that passing a
Throwableto this method will print the name of theThrowablebut no stack trace. To print a stack trace use theerror(Object, Throwable)form instead.
Supported API: true- Parameters:
message- the message object to log
-
isDebugEnabled
public boolean isDebugEnabled()Check whether this category is enabled for theDEBUGLevel.This function is intended to lessen the computational cost of disabled log debug statements.
For some
catCategory object, when you write,cat.debug("This is entry number: " + i);You incur the cost constructing the message, concatenatiion in this case, regardless of whether the message is logged or not.
If you are worried about speed, then you should write
if (cat.isDebugEnabled()) { cat.debug("This is entry number: " + i); }This way you will not incur the cost of parameter construction if debugging is disabled for
cat. On the other hand, if thecatis debug enabled, you will incur the cost of evaluating whether the category is debug enabled twice. Once inisDebugEnabledand once in thedebug. This is an insignificant overhead since evaluating a category takes about 1%% of the time it takes to actually log.
Supported API: true- Returns:
- boolean -
trueif this category is debug enabled,falseotherwise.
-
debug
Log a message object with thelevel.invalid reference
DEBUGThis method first checks if this category is
DEBUGenabled by comparing the level of this category with thelevel. If this category isinvalid reference
DEBUGDEBUGenabled, then it converts the message object (passed as parameter) to a string. It then proceeds to call all the registered appenders in this category and also higher in the hierarchy depending on the value of the additivity flag.WARNING Note that passing a
Throwableto this method will print the name of theThrowablebut no stack trace. To print a stack trace use thedebug(Object, Throwable)form instead.
Supported API: true- Parameters:
message- the message object to log.
-
trace
Log trace messages.
Supported API: true- Parameters:
message-
-
debug
Log debug messages.
Supported API: true- Parameters:
message-
-
debug
Log debug messages.
Supported API: true- Parameters:
message-
-
debug
Log a message object with theDEBUGlevel including the stack trace of theThrowabletpassed as parameter.See
debug(Object)form for more detailed information.
Supported API: true- Parameters:
message- the message object to log.t- the exception to log, including its stack trace.
-
isInfoEnabled
public boolean isInfoEnabled()Check whether this category is enabled for the info Level. See alsoisDebugEnabled().
Supported API: true- Returns:
- boolean -
trueif this category is enabled for level info,falseotherwise.
-
info
Log a message object with theLevel.invalid reference
INFOThis method first checks if this category is
INFOenabled by comparing the level of this category withLevel. If the category isinvalid reference
INFOINFOenabled, then it converts the message object passed as parameter to a string. It proceeds to call all the registered appenders in this category and also higher in the hierarchy depending on the value of the additivity flag.WARNING Note that passing a
Throwableto this method will print the name of the Throwable but no stack trace. To print a stack trace use theinfo(Object, Throwable)form instead.
Supported API: true- Parameters:
message- the message object to log
-
info
Log a message object with theINFOlevel including the stack trace of theThrowabletpassed as parameter.See
info(Object)for more detailed information.
Supported API: true- Parameters:
message- the message object to log.t- the exception to log, including its stack trace.
-
isTraceEnabled
public boolean isTraceEnabled()Check whether this category is enabled for the TRACE Level.
Supported API: true- Returns:
- boolean -
trueif this category is enabled for level TRACE,falseotherwise.
-
trace
Log a message object with theTRACElevel including the stack trace of theThrowabletpassed as parameter.See
debug(Object)form for more detailed information.
Supported API: true- Parameters:
message- the message object to log.t- the exception to log, including its stack trace.
-
warn
Log a message object with theLevel.invalid reference
WARNThis method first checks if this category is
WARNenabled by comparing the level of this category withLevel. If the category isinvalid reference
WARNWARNenabled, then it converts the message object passed as parameter to a string. It proceeds to call all the registered appenders in this category and also higher in the hieararchy depending on the value of the additivity flag.WARNING Note that passing a
Throwableto this method will print the name of the Throwable but no stack trace. To print a stack trace use thewarn(Object, Throwable)form instead.
Supported API: true- Parameters:
message- the message object to log.
-
warn
Log a message with theWARNlevel including the stack trace of theThrowabletpassed as parameter.See
warn(Object)for more detailed information.
Supported API: true- Parameters:
message- the message object to log.t- the exception to log, including its stack trace.
-
fatal
Log a message object with theLevel.invalid reference
FATALThis method first checks if this category is
FATALenabled by comparing the level of this category withLevel. If the category isinvalid reference
FATALFATALenabled, then it converts the message object passed as parameter to a string. It proceeds to call all the registered appenders in this category and also higher in the hierarchy depending on the value of the additivity flag.WARNING Note that passing a
Throwableto this method will print the name of the Throwable but no stack trace. To print a stack trace use thefatal(Object, Throwable)form instead.
Supported API: true- Parameters:
message- the message object to log
-
fatal
Log a message object with theFATALlevel including the stack trace of theThrowabletpassed as parameter.See
fatal(Object)for more detailed information.
Supported API: true- Parameters:
message- the message object to log.t- the exception to log, including its stack trace.
-