|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.log5j.Logger
public final class Logger
The core class of the log5j package. All Loggers are instantiated from the
static getLogger(Object) method of this class. The various other
public methods allow the programmer to add logging at several levels from
trace(Object) to fatal(Object).
| Field Summary | |
|---|---|
static java.lang.String |
VERSION
The log5j version string. |
| Method Summary | |
|---|---|
void |
debug(java.lang.Object... objects)
Log a message for a number of objects or primitives if the logging priority is DEBUG or lower. |
void |
debug(java.lang.Object object)
Log a message for a single object or primitive if the logging priority is DEBUG or lower. |
void |
debugf(java.lang.String format,
java.lang.Object... args)
Log a formatted message with the given object or primitive arguments if the logging priority is DEBUG or lower. |
void |
error(java.lang.Object... objects)
Log a message for a number of objects or primitives if the logging priority is ERROR or lower. |
void |
error(java.lang.Object object)
Log a message for a single object or primitive if the logging priority is DEBUG or lower. |
void |
errorf(java.lang.String format,
java.lang.Object... args)
Log a formatted message with the given object or primitive arguments if the logging priority is ERROR or lower. |
void |
fatal(java.lang.Object... objects)
Log a message for a number of objects or primitives if the logging priority is FATAL or lower. |
void |
fatal(java.lang.Object object)
Log a message for a single object or primitive if the logging priority is FATAL or lower. |
void |
fatalf(java.lang.String format,
java.lang.Object... args)
Log a formatted message with the given object or primitive arguments if the logging priority is FATAL or lower. |
static Logger |
getLogger(java.lang.Object object)
Return the Logger for the given argument. |
void |
info(java.lang.Object... objects)
Log a message for a number of objects or primitives if the logging priority is INFO or lower. |
void |
info(java.lang.Object object)
Log a message for a single object or primitive if the logging priority is INFO or lower. |
void |
infof(java.lang.String format,
java.lang.Object... args)
Log a formatted message with the given object or primitive arguments if the logging priority is INFO or lower. |
boolean |
isDebug()
Return true if the value for this Logger is
DEBUG or less |
boolean |
isError()
Return true if the value for this Logger is
ERROR or less |
boolean |
isFatal()
Return true if the value for this Logger is
FATAL or less |
boolean |
isInfo()
Return true if the value for this Logger is
INFO or less |
boolean |
isLevel(Level level)
Return true if the value for this Logger is
less than or equal to level.value |
boolean |
isTrace()
Return true if the value for this Logger is
TRACE or less |
boolean |
isWarn()
Return true if the value for this Logger is
WARN or less |
void |
log(Level level,
java.lang.Object... objects)
Log a message for a number of objects or primitives if the logging priority is equal to or lower than the level. |
void |
log(Level level,
java.lang.Object object)
Log a message for a single object or primitive if the logging priority is equal to or lower than the level. |
void |
logf(Level level,
java.lang.String format,
java.lang.Object... args)
Log a formatted message with the given object or primitive arguments if the logging priority is equal to or lower than the level. |
java.lang.String |
toString()
|
void |
trace(java.lang.Object... objects)
Log a message for a number of objects or primitives if the logging priority is TRACE or lower. |
void |
trace(java.lang.Object object)
Log a message for a single object or primitive if the logging priority is TRACE or lower. |
void |
tracef(java.lang.String format,
java.lang.Object... args)
Log a formatted message with the given object or primitive arguments if the logging priority is TRACE or lower. |
void |
warn(java.lang.Object... objects)
Log a message for a number of objects or primitives if the logging priority is WARN or lower. |
void |
warn(java.lang.Object object)
Log a message for a single object or primitive if the logging priority is WARN or lower. |
void |
warnf(java.lang.String format,
java.lang.Object... args)
Log a formatted message with the given object or primitive arguments if the logging priority is WARN or lower. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String VERSION
| Method Detail |
|---|
public static Logger getLogger(java.lang.Object object)
Logger for the given argument. If one does not
exist it will be instantiated at this point.
object - any object or a null
Logger for this object.public void debug(java.lang.Object... objects)
objects - any number of objects or primitivespublic void debug(java.lang.Object object)
object - a single object or primitive
public void debugf(java.lang.String format,
java.lang.Object... args)
Formatting for this method is the same as for
Formatter.format(String, Object...)
If an exception is thrown in formatting the message, the format string, arguments and the exception are logged without formatting.
format - A format string as described in Formatter string
syntax.args - Arguments referenced by the format specifiers in the format
string.Formatterpublic void error(java.lang.Object... objects)
objects - any number of objects or primitivespublic void error(java.lang.Object object)
object - a single object or primitive
public void errorf(java.lang.String format,
java.lang.Object... args)
Formatting for this method is the same as for
Formatter.format(String, Object...)
If an exception is thrown in formatting the message, the format string, arguments and the exception are logged without formatting.
format - A format string as described in Formatter string
syntax.args - Arguments referenced by the format specifiers in the format
string.Formatterpublic void fatal(java.lang.Object... objects)
objects - any number of objects or primitivespublic void fatal(java.lang.Object object)
object - a single object or primitive
public void fatalf(java.lang.String format,
java.lang.Object... args)
Formatting for this method is the same as for
Formatter.format(String, Object...)
If an exception is thrown in formatting the message, the format string, arguments and the exception are logged without formatting.
format - A format string as described in Formatter string
syntax.args - Arguments referenced by the format specifiers in the format
string.Formatterpublic void info(java.lang.Object... objects)
objects - any number of objects or primitivespublic void info(java.lang.Object object)
object - a single object or primitive
public void infof(java.lang.String format,
java.lang.Object... args)
Formatting for this method is the same as for
Formatter.format(String, Object...)
If an exception is thrown in formatting the message, the format string, arguments and the exception are logged without formatting.
format - A format string as described in Formatter string
syntax.args - Arguments referenced by the format specifiers in the format
string.Formatterpublic boolean isDebug()
value for this Logger is
DEBUG or less
value for this Logger
is DEBUG or lesspublic boolean isError()
value for this Logger is
ERROR or less
value for this Logger
is ERROR or lesspublic boolean isFatal()
value for this Logger is
FATAL or less
value for this Logger
is FATAL or lesspublic boolean isInfo()
value for this Logger is
INFO or less
value for this Logger
is INFO or lesspublic boolean isLevel(Level level)
value for this Logger is
less than or equal to level.value
level - the other Level
value for this Logger
is less than or equal to level.valuepublic boolean isTrace()
value for this Logger is
TRACE or less
value for this Logger
is TRACE or lesspublic boolean isWarn()
value for this Logger is
WARN or less
value for this Logger
is WARN or less
public void log(Level level,
java.lang.Object... objects)
level.
level - the logging level to test againstobjects - any number of objects or primitives
public void log(Level level,
java.lang.Object object)
level.
level - the logging level to test againstobject - a single object or primitive
public void logf(Level level,
java.lang.String format,
java.lang.Object... args)
level.
Formatting for this method is the same as for
Formatter.format(String, Object...)
If an exception is thrown in formatting the message, the format string, arguments and the exception are logged without formatting.
format - A format string as described in Formatter string
syntax.args - Arguments referenced by the format specifiers in the format
string.Formatterpublic java.lang.String toString()
toString in class java.lang.Objectpublic void trace(java.lang.Object... objects)
objects - any number of objects or primitivespublic void trace(java.lang.Object object)
object - a single object or primitive
public void tracef(java.lang.String format,
java.lang.Object... args)
Formatting for this method is the same as for
Formatter.format(String, Object...)
If an exception is thrown in formatting the message, the format string, arguments and the exception are logged without formatting.
format - A format string as described in Formatter string
syntax.args - Arguments referenced by the format specifiers in the format
string.Formatterpublic void warn(java.lang.Object... objects)
objects - any number of objects or primitivespublic void warn(java.lang.Object object)
object - a single object or primitive
public void warnf(java.lang.String format,
java.lang.Object... args)
Formatting for this method is the same as for
Formatter.format(String, Object...)
If an exception is thrown in formatting the message, the format string, arguments and the exception are logged without formatting.
format - A format string as described in Formatter string
syntax.args - Arguments referenced by the format specifiers in the format
string.Formatter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||