Java Doc for LogRecord.java in  » 6.0-JDK-Core » Collections-Jar-Zip-Logging-regex » java » util » logging » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » Collections Jar Zip Logging regex » java.util.logging 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.logging.LogRecord

LogRecord
public class LogRecord implements java.io.Serializable(Code)
LogRecord objects are used to pass logging requests between the logging framework and individual log Handlers.

When a LogRecord is passed into the logging framework it logically belongs to the framework and should no longer be used or updated by the client application.

Note that if the client application has not specified an explicit source method name and source class name, then the LogRecord class will infer them automatically when they are first accessed (due to a call on getSourceMethodName or getSourceClassName) by analyzing the call stack. Therefore, if a logging Handler wants to pass off a LogRecord to another thread, or to transmit it over RMI, and if it wishes to subsequently obtain method name or class name information it should call one of getSourceClassName or getSourceMethodName to force the values to be filled in.

Serialization notes:

  • The LogRecord class is serializable.
  • Because objects in the parameters array may not be serializable, during serialization all objects in the parameters array are written as the corresponding Strings (using Object.toString).
  • The ResourceBundle is not transmitted as part of the serialized form, but the resource bundle name is, and the recipient object's readObject method will attempt to locate a suitable resource bundle.

version:
   1.31, 05/09/07
since:
   1.4



Constructor Summary
public  LogRecord(Level level, String msg)
     Construct a LogRecord with the given level and message values.

The sequence property will be initialized with a new unique value. These sequence values are allocated in increasing order within a VM.

The millis property will be initialized to the current time.

The thread ID property will be initialized with a unique ID for the current thread.

All other properties will be initialized to "null".


Method Summary
public  LevelgetLevel()
     Get the logging message level, for example Level.SEVERE.
public  StringgetLoggerName()
    
public  StringgetMessage()
     Get the "raw" log message, before localization or formatting.
public  longgetMillis()
     Get event time in milliseconds since 1970.
public  Object[]getParameters()
     Get the parameters to the log message. the log message parameters.
public  ResourceBundlegetResourceBundle()
     Get the localization resource bundle

This is the ResourceBundle that should be used to localize the message string before formatting it.

public  StringgetResourceBundleName()
     Get the localization resource bundle name

This is the name for the ResourceBundle that should be used to localize the message string before formatting it.

public  longgetSequenceNumber()
     Get the sequence number.
public  StringgetSourceClassName()
     Get the name of the class that (allegedly) issued the logging request.

Note that this sourceClassName is not verified and may be spoofed. This information may either have been provided as part of the logging call, or it may have been inferred automatically by the logging framework.

public  StringgetSourceMethodName()
     Get the name of the method that (allegedly) issued the logging request.

Note that this sourceMethodName is not verified and may be spoofed. This information may either have been provided as part of the logging call, or it may have been inferred automatically by the logging framework.

public  intgetThreadID()
     Get an identifier for the thread where the message originated.
public  ThrowablegetThrown()
     Get any throwable associated with the log record.

If the event involved an exception, this will be the exception object.

public  voidsetLevel(Level level)
     Set the logging message level, for example Level.SEVERE.
public  voidsetLoggerName(String name)
     Set the source Logger name.
public  voidsetMessage(String message)
     Set the "raw" log message, before localization or formatting.
public  voidsetMillis(long millis)
     Set event time.
public  voidsetParameters(Object parameters)
     Set the parameters to the log message.
Parameters:
  parameters - the log message parameters.
public  voidsetResourceBundle(ResourceBundle bundle)
     Set the localization resource bundle.
public  voidsetResourceBundleName(String name)
     Set the localization resource bundle name.
public  voidsetSequenceNumber(long seq)
     Set the sequence number.
public  voidsetSourceClassName(String sourceClassName)
     Set the name of the class that (allegedly) issued the logging request.
public  voidsetSourceMethodName(String sourceMethodName)
     Set the name of the method that (allegedly) issued the logging request.
public  voidsetThreadID(int threadID)
     Set an identifier for the thread where the message originated.
public  voidsetThrown(Throwable thrown)
     Set a throwable associated with the log event.


Constructor Detail
LogRecord
public LogRecord(Level level, String msg)(Code)
Construct a LogRecord with the given level and message values.

The sequence property will be initialized with a new unique value. These sequence values are allocated in increasing order within a VM.

The millis property will be initialized to the current time.

The thread ID property will be initialized with a unique ID for the current thread.

All other properties will be initialized to "null".
Parameters:
  level - a logging level value
Parameters:
  msg - the raw non-localized logging message (may be null)





Method Detail
getLevel
public Level getLevel()(Code)
Get the logging message level, for example Level.SEVERE. the logging message level



getLoggerName
public String getLoggerName()(Code)
Get the source Logger name's source logger name (may be null)



getMessage
public String getMessage()(Code)
Get the "raw" log message, before localization or formatting.

May be null, which is equivalent to the empty string "".

This message may be either the final text or a localization key.

During formatting, if the source logger has a localization ResourceBundle and if that ResourceBundle has an entry for this message string, then the message string is replaced with the localized value. the raw message string




getMillis
public long getMillis()(Code)
Get event time in milliseconds since 1970. event time in millis since 1970



getParameters
public Object[] getParameters()(Code)
Get the parameters to the log message. the log message parameters. May be null ifthere are no parameters.



getResourceBundle
public ResourceBundle getResourceBundle()(Code)
Get the localization resource bundle

This is the ResourceBundle that should be used to localize the message string before formatting it. The result may be null if the message is not localizable, or if no suitable ResourceBundle is available.




getResourceBundleName
public String getResourceBundleName()(Code)
Get the localization resource bundle name

This is the name for the ResourceBundle that should be used to localize the message string before formatting it. The result may be null if the message is not localizable.




getSequenceNumber
public long getSequenceNumber()(Code)
Get the sequence number.

Sequence numbers are normally assigned in the LogRecord constructor, which assigns unique sequence numbers to each new LogRecord in increasing order. the sequence number




getSourceClassName
public String getSourceClassName()(Code)
Get the name of the class that (allegedly) issued the logging request.

Note that this sourceClassName is not verified and may be spoofed. This information may either have been provided as part of the logging call, or it may have been inferred automatically by the logging framework. In the latter case, the information may only be approximate and may in fact describe an earlier call on the stack frame.

May be null if no information could be obtained. the source class name




getSourceMethodName
public String getSourceMethodName()(Code)
Get the name of the method that (allegedly) issued the logging request.

Note that this sourceMethodName is not verified and may be spoofed. This information may either have been provided as part of the logging call, or it may have been inferred automatically by the logging framework. In the latter case, the information may only be approximate and may in fact describe an earlier call on the stack frame.

May be null if no information could be obtained. the source method name




getThreadID
public int getThreadID()(Code)
Get an identifier for the thread where the message originated.

This is a thread identifier within the Java VM and may or may not map to any operating system ID. thread ID




getThrown
public Throwable getThrown()(Code)
Get any throwable associated with the log record.

If the event involved an exception, this will be the exception object. Otherwise null. a throwable




setLevel
public void setLevel(Level level)(Code)
Set the logging message level, for example Level.SEVERE.
Parameters:
  level - the logging message level



setLoggerName
public void setLoggerName(String name)(Code)
Set the source Logger name.
Parameters:
  name - the source logger name (may be null)



setMessage
public void setMessage(String message)(Code)
Set the "raw" log message, before localization or formatting.
Parameters:
  message - the raw message string (may be null)



setMillis
public void setMillis(long millis)(Code)
Set event time.
Parameters:
  millis - event time in millis since 1970



setParameters
public void setParameters(Object parameters)(Code)
Set the parameters to the log message.
Parameters:
  parameters - the log message parameters. (may be null)



setResourceBundle
public void setResourceBundle(ResourceBundle bundle)(Code)
Set the localization resource bundle.
Parameters:
  bundle - localization bundle (may be null)



setResourceBundleName
public void setResourceBundleName(String name)(Code)
Set the localization resource bundle name.
Parameters:
  name - localization bundle name (may be null)



setSequenceNumber
public void setSequenceNumber(long seq)(Code)
Set the sequence number.

Sequence numbers are normally assigned in the LogRecord constructor, so it should not normally be necessary to use this method.




setSourceClassName
public void setSourceClassName(String sourceClassName)(Code)
Set the name of the class that (allegedly) issued the logging request.
Parameters:
  sourceClassName - the source class name (may be null)



setSourceMethodName
public void setSourceMethodName(String sourceMethodName)(Code)
Set the name of the method that (allegedly) issued the logging request.
Parameters:
  sourceMethodName - the source method name (may be null)



setThreadID
public void setThreadID(int threadID)(Code)
Set an identifier for the thread where the message originated.
Parameters:
  threadID - the thread ID



setThrown
public void setThrown(Throwable thrown)(Code)
Set a throwable associated with the log event.
Parameters:
  thrown - a throwable (may be null)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.