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.

java.util.logging.LogRecord

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 ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.