java.lang.Object | |
↳ | org.apache.log4j.lf5.LogRecord |
Known Direct Subclasses |
LogRecord. A LogRecord encapsulates the details of your desired log request.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
_category | |||||||||||
_level | |||||||||||
_location | |||||||||||
_message | |||||||||||
_millis | |||||||||||
_ndc | |||||||||||
_seqCount | |||||||||||
_sequenceNumber | |||||||||||
_thread | |||||||||||
_thrown | |||||||||||
_thrownStackTrace |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get the category asscociated with this LogRecord.
| |||||||||||
Get the level of this LogRecord.
| |||||||||||
Get the location in code where this LogRecord originated.
| |||||||||||
Get the message asscociated with this LogRecord.
| |||||||||||
Get the event time of this record in milliseconds from 1970.
| |||||||||||
Get the NDC (nested diagnostic context) for this record.
| |||||||||||
Get the sequence number associated with this LogRecord.
| |||||||||||
Get the thread description asscociated with this LogRecord.
| |||||||||||
Get the Throwable associated with this LogRecord.
| |||||||||||
Get the stack trace in a String-based format for the associated Throwable
of this LogRecord.
| |||||||||||
Abstract method.
| |||||||||||
Resets that sequence number to 0.
| |||||||||||
Set the category associated with this LogRecord.
| |||||||||||
Set the level of this LogRecord.
| |||||||||||
Set the location in code where this LogRecord originated.
| |||||||||||
Set the message associated with this LogRecord.
| |||||||||||
Set the event time of this record.
| |||||||||||
Set the NDC (nested diagnostic context) for this record.
| |||||||||||
Set the sequence number assocsiated with this LogRecord.
| |||||||||||
Set the thread description associated with this LogRecord.
| |||||||||||
Set the Throwable associated with this LogRecord.
| |||||||||||
Set the ThrownStackTrace for the log record.
| |||||||||||
Return a String representation of this LogRecord.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Get the category asscociated with this LogRecord. For a more detailed description of what a category is see setCategory().
Get the level of this LogRecord.
Get the location in code where this LogRecord originated.
Get the message asscociated with this LogRecord.
Get the event time of this record in milliseconds from 1970. When a LogRecord is constructed the event time is set but may be overridden by calling setMillis();
Get the NDC (nested diagnostic context) for this record.
Get the sequence number associated with this LogRecord. Sequence numbers are generally assigned when a LogRecord is constructed. Sequence numbers start at 0 and increase with each newly constructed LogRocord.
Get the thread description asscociated with this LogRecord. When a LogRecord is constructed, the thread description is set by calling: Thread.currentThread().toString(). You may supply a thread description of your own by calling the setThreadDescription(String) method.
Get the Throwable associated with this LogRecord.
Get the stack trace in a String-based format for the associated Throwable of this LogRecord. The stack trace in a String-based format is set when the setThrown(Throwable) method is called.
Why do we need this method considering that we have the getThrown() and setThrown() methods? A Throwable object may not be serializable, however, a String representation of it is. Users of LogRecords should generally call this method over getThrown() for the reasons of serialization.
Abstract method. Must be overridden to indicate what log level to show in red.
Resets that sequence number to 0.
Set the category associated with this LogRecord. A category represents a hierarchical dot (".") separated namespace for messages. The definition of a category is application specific, but a common convention is as follows:
When logging messages
for a particluar class you can use its class name:
com.thoughtworks.framework.servlet.ServletServiceBroker.
Futhermore, to log a message for a particular method in a class
add the method name:
com.thoughtworks.framework.servlet.ServletServiceBroker.init().
category | The category for this record. |
---|
Set the level of this LogRecord.
level | The LogLevel for this record. |
---|
Set the location in code where this LogRecord originated.
location | A string containing location information. |
---|
Set the message associated with this LogRecord.
message | The message for this record. |
---|
Set the event time of this record. When a LogRecord is constructed the event time is set but may be overridden by calling this method.
millis | The time in milliseconds from 1970. |
---|
Set the NDC (nested diagnostic context) for this record.
ndc | A string representing the NDC. |
---|
Set the sequence number assocsiated with this LogRecord. A sequence number will automatically be assigned to evey newly constructed LogRecord, however, this method can override the value.
number | The sequence number. |
---|
Set the thread description associated with this LogRecord. When a LogRecord is constructed, the thread description is set by calling: Thread.currentThread().toString(). You may supply a thread description of your own by calling this method.
threadDescription | The description of the thread for this record. |
---|
Set the Throwable associated with this LogRecord. When this method is called, the stack trace in a String-based format is made available via the getThrownStackTrace() method.
thrown | A Throwable to associate with this LogRecord. |
---|
Set the ThrownStackTrace for the log record.
trace | A String to associate with this LogRecord |
---|
Return a String representation of this LogRecord.