).
The output includes the relative time in milliseconds, thread name, the level,
logger name, and the message followed by the line separator for the host.
In log4j terms it amounts to the "%r [%t] %level %logger - %m%n" pattern.
176 [main] INFO examples.Sort - Populating an array of 2 elements in reverse order.
225 [main] INFO examples.SortAlgo - Entered the sort method.
304 [main] INFO SortAlgo.DUMP - Dump of interger array:
317 [main] INFO SortAlgo.DUMP - Element [0] = 0
331 [main] INFO SortAlgo.DUMP - Element [1] = 1
343 [main] INFO examples.Sort - The next log statement should be an error message.
346 [main] ERROR SortAlgo.DUMP - Tried to dump an uninitialized array.
at org.log4j.examples.SortAlgo.dump(SortAlgo.java:58)
at org.log4j.examples.Sort.main(Sort.java:64)
467 [main] INFO examples.Sort - Exiting main method.
- Author:
- Ceki Gülcü
Method Summary |
void |
debug(Object msg)
A NOP implementation. |
void |
debug(Object parameterizedMsg,
Object param1)
A NOP implementation. |
void |
debug(Object msg,
Throwable t)
A NOP implementation. |
void |
debug(String parameterizedMsg,
Object param1,
Object param2)
A NOP implementation. |
void |
error(Object msg)
A simple implementation which always logs messages of level ERROR acoording
to the format outlined above. |
void |
error(Object parameterizedMsg,
Object param1)
Perform single parameter substitution before logging the message of level
ERROR according to the format outlined above. |
void |
error(Object msg,
Throwable t)
Log a message of level ERROR, including an exception. |
void |
error(String parameterizedMsg,
Object param1,
Object param2)
Perform double parameter substitution before logging the message of level
ERROR according to the format outlined above. |
static SimpleULogger |
getLogger(String name)
Creates a new instance. |
void |
info(Object msg)
A simple implementation which always logs messages of level INFO according
to the format outlined above. |
void |
info(Object parameterizedMsg,
Object param1)
Perform single parameter substitution before logging the message of level
INFO according to the format outlined above. |
void |
info(Object msg,
Throwable t)
Log a message of level INFO, including an exception. |
void |
info(String parameterizedMsg,
Object param1,
Object param2)
Perform double parameter substitution before logging the message of level
INFO according to the format outlined above. |
boolean |
isDebugEnabled()
Always returns false. |
boolean |
isErrorEnabled()
Always returns true. |
boolean |
isInfoEnabled()
Always returns true. |
boolean |
isWarnEnabled()
Always returns true. |
void |
warn(Object msg)
A simple implementation which always logs messages of level WARN according
to the format outlined above. |
void |
warn(Object parameterizedMsg,
Object param1)
Perform single parameter substitution before logging the message of level
WARN according to the format outlined above. |
void |
warn(Object msg,
Throwable t)
Log a message of level WARN, including an exception. |
void |
warn(String parameterizedMsg,
Object param1,
Object param2)
Perform double parameter substitution before logging the message of level
WARN according to the format outlined above. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LINE_SEPARATOR
public static final String LINE_SEPARATOR
getLogger
public static SimpleULogger getLogger(String name)
- Creates a new instance.
- Parameters:
name
- logger name- Returns:
- logger.
isDebugEnabled
public boolean isDebugEnabled()
- Always returns false.
- Specified by:
isDebugEnabled
in interface ULogger
- Following copied from interface:
org.apache.log4j.ULogger
- Returns:
- true if debug is enabled.
debug
public void debug(Object msg)
- A NOP implementation.
- Specified by:
debug
in interface ULogger
- Following copied from interface:
org.apache.log4j.ULogger
- Parameters:
msg
- - the message object to be logged
debug
public void debug(Object parameterizedMsg,
Object param1)
- A NOP implementation.
- Specified by:
debug
in interface ULogger
- Following copied from interface:
org.apache.log4j.ULogger
- Parameters:
parameterizedMsg
- - the parameterized message objectparam1
- - the parameter
debug
public void debug(String parameterizedMsg,
Object param1,
Object param2)
- A NOP implementation.
- Specified by:
debug
in interface ULogger
- Following copied from interface:
org.apache.log4j.ULogger
- Parameters:
parameterizedMsg
- - the parameterized message objectparam1
- - the first parameterparam2
- - the second parameter
debug
public void debug(Object msg,
Throwable t)
- A NOP implementation.
- Specified by:
debug
in interface ULogger
isInfoEnabled
public boolean isInfoEnabled()
- Always returns true.
- Specified by:
isInfoEnabled
in interface ULogger
info
public void info(Object msg)
- A simple implementation which always logs messages of level INFO according
to the format outlined above.
- Specified by:
info
in interface ULogger
info
public void info(Object parameterizedMsg,
Object param1)
- Perform single parameter substitution before logging the message of level
INFO according to the format outlined above.
- Specified by:
info
in interface ULogger
info
public void info(String parameterizedMsg,
Object param1,
Object param2)
- Perform double parameter substitution before logging the message of level
INFO according to the format outlined above.
- Specified by:
info
in interface ULogger
info
public void info(Object msg,
Throwable t)
- Log a message of level INFO, including an exception.
- Specified by:
info
in interface ULogger
isWarnEnabled
public boolean isWarnEnabled()
- Always returns true.
- Specified by:
isWarnEnabled
in interface ULogger
warn
public void warn(Object msg)
- A simple implementation which always logs messages of level WARN according
to the format outlined above.
- Specified by:
warn
in interface ULogger
warn
public void warn(Object parameterizedMsg,
Object param1)
- Perform single parameter substitution before logging the message of level
WARN according to the format outlined above.
- Specified by:
warn
in interface ULogger
warn
public void warn(String parameterizedMsg,
Object param1,
Object param2)
- Perform double parameter substitution before logging the message of level
WARN according to the format outlined above.
- Specified by:
warn
in interface ULogger
warn
public void warn(Object msg,
Throwable t)
- Log a message of level WARN, including an exception.
- Specified by:
warn
in interface ULogger
isErrorEnabled
public boolean isErrorEnabled()
- Always returns true.
- Specified by:
isErrorEnabled
in interface ULogger
error
public void error(Object msg)
- A simple implementation which always logs messages of level ERROR acoording
to the format outlined above.
- Specified by:
error
in interface ULogger
error
public void error(Object parameterizedMsg,
Object param1)
- Perform single parameter substitution before logging the message of level
ERROR according to the format outlined above.
- Specified by:
error
in interface ULogger
error
public void error(String parameterizedMsg,
Object param1,
Object param2)
- Perform double parameter substitution before logging the message of level
ERROR according to the format outlined above.
- Specified by:
error
in interface ULogger
error
public void error(Object msg,
Throwable t)
- Log a message of level ERROR, including an exception.
- Specified by:
error
in interface ULogger
Copyright © 2000-2006 Apache Software Foundation.
Licensed under the Apache License, Version 2.0.