java.lang.Object | |||
↳ | org.apache.log4j.Category | ||
↳ | org.apache.log4j.Logger | ||
↳ | org.apache.log4j.spi.NOPLogger |
No-operation implementation of Logger used by NOPLoggerRepository.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.log4j.Category
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create instance of Logger.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add
newAppender to the list of appenders of this
Category instance. | |||||||||||
Call the appenders in the hierrachy starting at
this . | |||||||||||
Log a message object with the
DEBUG level including
the stack trace of the Throwable t passed as
parameter. | |||||||||||
Log a message object with the
DEBUG level. | |||||||||||
Log a message object with the
ERROR Level. | |||||||||||
Log a message object with the
ERROR level including
the stack trace of the Throwable t passed as
parameter. | |||||||||||
Log a message object with the
FATAL Level. | |||||||||||
Log a message object with the
FATAL level including
the stack trace of the Throwable t passed as
parameter. | |||||||||||
Get the appenders contained in this category as an Enumeration.
| |||||||||||
Look for the appender named as
name . | |||||||||||
This method is deprecated.
Please use the the
getEffectiveLevel() method
instead.
| |||||||||||
Starting from this category, search the category hierarchy for a
non-null level and return it.
| |||||||||||
Return the inherited ResourceBundle for this
category.
| |||||||||||
Log a message object with the
INFO Level. | |||||||||||
Log a message object with the
INFO level including
the stack trace of the Throwable t passed as
parameter. | |||||||||||
Is the appender passed as parameter attached to this category?
| |||||||||||
Check whether this category is enabled for the
DEBUG
Level. | |||||||||||
Check whether this category is enabled for a given
Level passed as parameter. | |||||||||||
Check whether this category is enabled for the info Level.
| |||||||||||
Check whether this category is enabled for the TRACE Level.
| |||||||||||
Log a localized and parameterized message.
| |||||||||||
Log a localized message.
| |||||||||||
This is the most generic printing method.
| |||||||||||
This generic form is intended to be used by wrappers.
| |||||||||||
This generic form is intended to be used by wrappers.
| |||||||||||
Remove all previously added appenders from this Category
instance.
| |||||||||||
Remove the appender with the name passed as parameter form the
list of appenders.
| |||||||||||
Remove the appender passed as parameter form the list of appenders.
| |||||||||||
Set the level of this Category.
| |||||||||||
This method is deprecated.
Please use
setLevel(Level) instead.
| |||||||||||
Set the resource bundle to be used with localized logging
methods
l7dlog(Priority, String, Throwable) and l7dlog(Priority, String, Object[], Throwable) . | |||||||||||
Log a message object with the
TRACE level. | |||||||||||
Log a message object with the
TRACE level including the
stack trace of the Throwablet passed as parameter. | |||||||||||
Log a message with the
WARN level including the
stack trace of the Throwable t passed as
parameter. | |||||||||||
Log a message object with the
WARN Level. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.log4j.Logger
| |||||||||||
From class
org.apache.log4j.Category
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.apache.log4j.spi.AppenderAttachable
|
Create instance of Logger.
repo | repository, may not be null. |
---|---|
name | name, may not be null, use "root" for root logger. |
Add newAppender
to the list of appenders of this
Category instance.
If newAppender
is already in the list of
appenders, then it won't be added again.
If assertion
parameter is false
, then
logs msg
as an error
statement.
The assert
method has been renamed to
assertLog
because assert
is a language
reserved word in JDK 1.4.
msg | The message to print if assertion is
false. |
---|
Call the appenders in the hierrachy starting at
this
. If no appenders could be found, emit a
warning.
This method calls all the appenders inherited from the hierarchy circumventing any evaluation of whether to log or not to log the particular log request.
event | the event to log. |
---|
Log a message object with the DEBUG
level including
the stack trace of the Throwable t
passed as
parameter.
See debug(Object)
form for more detailed information.
message | the message object to log. |
---|---|
t | the exception to log, including its stack trace. |
Log a message object with the DEBUG
level.
This method first checks if this category is DEBUG
enabled by comparing the level of this category with the DEBUG
level. If this category is
DEBUG
enabled, then it converts the message object
(passed as parameter) to a string by invoking the appropriate
ObjectRenderer
. 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 Throwable to this
method will print the name of the Throwable
but no
stack trace. To print a stack trace use the debug(Object, Throwable)
form instead.
message | the message object to log. |
---|
Log a message object with the ERROR
Level.
This method first checks if this category is ERROR
enabled by comparing the level of this category with ERROR
Level. If this category is ERROR
enabled, then it converts the message object passed as parameter
to a string by invoking the appropriate ObjectRenderer
. 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 Throwable to this
method will print the name of the Throwable
but no
stack trace. To print a stack trace use the error(Object, Throwable)
form instead.
message | the message object to log |
---|
Log a message object with the ERROR
level including
the stack trace of the Throwable t
passed as
parameter.
See error(Object)
form for more detailed information.
message | the message object to log. |
---|---|
t | the exception to log, including its stack trace. |
Log a message object with the FATAL
Level.
This method first checks if this category is FATAL
enabled by comparing the level of this category with FATAL
Level. If the category is FATAL
enabled, then it converts the message object passed as parameter
to a string by invoking the appropriate
ObjectRenderer
. 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 Throwable to this
method will print the name of the Throwable but no stack trace. To
print a stack trace use the fatal(Object, Throwable)
form
instead.
message | the message object to log |
---|
Log a message object with the FATAL
level including
the stack trace of the Throwable t
passed as
parameter.
See fatal(Object)
for more detailed information.
message | the message object to log. |
---|---|
t | the exception to log, including its stack trace. |
Get the appenders contained in this category as an Enumeration. If no appenders can be found, then a NullEnumeration
is returned.
Look for the appender named as name
.
Return the appender with that name if in the list. Return
null
otherwise.
Starting from this category, search the category hierarchy for a non-null level and return it. Otherwise, return the level of the root category.
The Category class is designed so that this method executes as quickly as possible.
Return the inherited ResourceBundle for this category.
This method walks the hierarchy to find the appropriate
resource bundle. It will return the resource bundle attached to
the closest ancestor of this category, much like the way
priorities are searched. In case there is no bundle in the
hierarchy then null
is returned.
Log a message object with the INFO
Level.
This method first checks if this category is INFO
enabled by comparing the level of this category with INFO
Level. If the category is INFO
enabled, then it converts the message object passed as parameter
to a string by invoking the appropriate
ObjectRenderer
. 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 Throwable to this
method will print the name of the Throwable but no stack trace. To
print a stack trace use the info(Object, Throwable)
form
instead.
message | the message object to log |
---|
Log a message object with the INFO
level including
the stack trace of the Throwable t
passed as
parameter.
See info(Object)
for more detailed information.
message | the message object to log. |
---|---|
t | the exception to log, including its stack trace. |
Is the appender passed as parameter attached to this category?
Check whether this category is enabled for the DEBUG
Level.
This function is intended to lessen the computational cost of disabled log debug statements.
For some cat
Category 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 the cat
is debug enabled, you
will incur the cost of evaluating whether the category is debug
enabled twice. Once in isDebugEnabled
and once in
the debug
. This is an insignificant overhead
since evaluating a category takes about 1%% of the time it
takes to actually log.
true
if this category is debug
enabled, false
otherwise.
Check whether this category is enabled for a given Level
passed as parameter.
See also isDebugEnabled()
.
level
.
Check whether this category is enabled for the info Level.
See also isDebugEnabled()
.
true
if this category is enabled
for level info, false
otherwise.
Check whether this category is enabled for the TRACE Level.
true
if this category is enabled for level
TRACE, false
otherwise.
Log a localized and parameterized message. First, the user
supplied key
is searched in the resource
bundle. Next, the resulting pattern is formatted using
format(String, Object[])
method with the
user supplied object array params
.
Log a localized message. The user supplied parameter
key
is replaced by its localized version from the
resource bundle.
This is the most generic printing method. It is intended to be invoked by wrapper classes.
callerFQCN | The wrapper class' fully qualified class name. |
---|---|
level | The level of the logging request. |
message | The message of the logging request. |
t | The throwable of the logging request, may be null. |
This generic form is intended to be used by wrappers.
This generic form is intended to be used by wrappers.
Remove all previously added appenders from this Category instance.
This is useful when re-reading configuration information.
Remove the appender with the name passed as parameter form the list of appenders.
Remove the appender passed as parameter form the list of appenders.
Set the level of this Category. If you are passing any of
Level.DEBUG
, Level.INFO
,
Level.WARN
, Level.ERROR
,
Level.FATAL
as a parameter, you need to case them as
Level.
As in
logger.setLevel((Level) Level.DEBUG);
Null values are admitted.
This method is deprecated.
Please use setLevel(Level)
instead.
Set the level of this Category.
Null values are admitted.
Set the resource bundle to be used with localized logging
methods l7dlog(Priority, String, Throwable)
and l7dlog(Priority, String, Object[], Throwable)
.
Log a message object with the TRACE
level.
message | the message object to log. |
---|
Log a message object with the TRACE
level including the
stack trace of the Throwablet
passed as parameter.
See debug(Object)
form for more detailed information.
message | the message object to log. |
---|---|
t | the exception to log, including its stack trace. |
Log a message with the WARN
level including the
stack trace of the Throwable t
passed as
parameter.
See warn(Object)
for more detailed information.
message | the message object to log. |
---|---|
t | the exception to log, including its stack trace. |
Log a message object with the WARN
Level.
This method first checks if this category is WARN
enabled by comparing the level of this category with WARN
Level. If the category is WARN
enabled, then it converts the message object passed as parameter
to a string by invoking the appropriate
ObjectRenderer
. 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 Throwable to this
method will print the name of the Throwable but no stack trace. To
print a stack trace use the warn(Object, Throwable)
form
instead.
message | the message object to log. |
---|