Name
LogRecord
Synopsis
Instances of
this class are used to represent log messages as they are passed
between Logger, Handler,
Filter and Formatter objects.
LogRecord defines a number of JavaBeans-type
property getter and setter methods. The values of the various
properties encapsulate all details of the log message. The
LogRecord( ) constructor takes arguments for the
two most important properties: the log level and the log message (or
localization key). The constructor also initializes the
millis property to the current time, the
sequenceNumber property to a unique (within the
VM) value that can be used to compare the order of two log messages,
and the threadID property to a unique identifier
for the current thread. All other properties of the
LogRecord are left uninitialized with their
default null values.
Figure 16-118. java.util.logging.LogRecord
public class LogRecord implements Serializable { // Public Constructors public LogRecord(Level level, String msg); // Public Instance Methods public Level getLevel( ); public String getLoggerName( ); public String getMessage( ); public long getMillis( ); public Object[ ] getParameters( ); public java.util.ResourceBundle getResourceBundle( ); public String getResourceBundleName( ); public long getSequenceNumber( ); public String getSourceClassName( ); public String getSourceMethodName( ); public int getThreadID( ); public Throwable getThrown ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access