java.lang.Object | |
↳ | java.util.logging.LogRecord |
A LogRecord
object represents a logging request. It is passed between
the logging framework and individual logging handlers. Client applications
should not modify a LogRecord
object that has been passed into the
logging framework.
The LogRecord
class will infer the source method name and source
class name the first time they are accessed if the client application didn't
specify them explicitly. This automatic inference is based on the analysis of
the call stack and is not guaranteed to be precise. Client applications
should force the initialization of these two fields by calling
getSourceClassName
or getSourceMethodName
if they expect to
use them after passing the LogRecord
object to another thread or
transmitting it over RMI.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a
LogRecord object using the supplied the logging
level and message. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the logging level.
| |||||||||||
Gets the name of the logger.
| |||||||||||
Gets the raw message.
| |||||||||||
Gets the time when this event occurred, in milliseconds since 1970.
| |||||||||||
Gets the parameters.
| |||||||||||
Gets the resource bundle used to localize the raw message during
formatting.
| |||||||||||
Gets the name of the resource bundle.
| |||||||||||
Gets the sequence number.
| |||||||||||
Gets the name of the class that is the source of this log record.
| |||||||||||
Gets the name of the method that is the source of this log record.
| |||||||||||
Gets a unique ID of the thread originating the log record.
| |||||||||||
Gets the
Throwable object associated with this log record. | |||||||||||
Sets the logging level.
| |||||||||||
Sets the name of the logger.
| |||||||||||
Sets the raw message.
| |||||||||||
Sets the time when this event occurred, in milliseconds since 1970.
| |||||||||||
Sets the parameters.
| |||||||||||
Sets the resource bundle used to localize the raw message during
formatting.
| |||||||||||
Sets the name of the resource bundle.
| |||||||||||
Sets the sequence number.
| |||||||||||
Sets the name of the class that is the source of this log record.
| |||||||||||
Sets the name of the method that is the source of this log record.
| |||||||||||
Sets the ID of the thread originating this log record.
| |||||||||||
Sets the
Throwable object associated with this log record. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Constructs a LogRecord
object using the supplied the logging
level and message. The millis property is set to the current time. The
sequence property is set to a new unique value, allocated in increasing
order within the virtual machine. The thread ID is set to a unique value
for the current thread. All other properties are set to null
.
level | the logging level, may not be null . |
---|---|
msg | the raw message. |
NullPointerException | if level is null .
|
---|
Gets the name of the logger.
Gets the raw message.
null
.
Gets the time when this event occurred, in milliseconds since 1970.
Gets the parameters.
null
if there are no
parameters.
Gets the resource bundle used to localize the raw message during formatting.
null
if none is
available or the message is not localizable.
Gets the name of the resource bundle.
null
if none is
available or the message is not localizable.
Gets the sequence number.
Gets the name of the class that is the source of this log record. This
information can be changed, may be null
and is untrusted.
null
)
Gets the name of the method that is the source of this log record.
Gets a unique ID of the thread originating the log record. Every thread becomes a different ID.
Notice : the ID doesn't necessary map the OS thread ID
Gets the Throwable
object associated with this log record.
Throwable
object associated with this log record.
Sets the logging level.
level | the level to set. |
---|
NullPointerException | if level is null .
|
---|
Sets the name of the logger.
loggerName | the logger name to set. |
---|
Sets the raw message. When this record is formatted by a logger that has
a localization resource bundle that contains an entry for message
,
then the raw message is replaced with its localized version.
message | the raw message to set, may be null .
|
---|
Sets the time when this event occurred, in milliseconds since 1970.
millis | the time when this event occurred, in milliseconds since 1970. |
---|
Sets the parameters.
parameters | the array of parameters to set, may be null .
|
---|
Sets the resource bundle used to localize the raw message during formatting.
resourceBundle | the resource bundle to set, may be null .
|
---|
Sets the name of the resource bundle.
resourceBundleName | the name of the resource bundle to set. |
---|
Sets the sequence number. It is usually not necessary to call this method to change the sequence number because the number is allocated when this instance is constructed.
sequenceNumber | the sequence number to set. |
---|
Sets the name of the class that is the source of this log record.
sourceClassName | the name of the source class of this log record, may be
null .
|
---|
Sets the name of the method that is the source of this log record.
sourceMethodName | the name of the source method of this log record, may be
null .
|
---|
Sets the ID of the thread originating this log record.
threadID | the new ID of the thread originating this log record. |
---|
Sets the Throwable
object associated with this log record.
thrown | the new Throwable object to associate with this log
record.
|
---|