1 *java.util.logging.LogRecord* *LogRecord* LogRecord objects are used to pass log
4 extends |java.lang.Object|
5 implements |java.io.Serializable|
7 |java.util.logging.LogRecord_Description|
8 |java.util.logging.LogRecord_Fields|
9 |java.util.logging.LogRecord_Constructors|
10 |java.util.logging.LogRecord_Methods|
12 ================================================================================
14 *java.util.logging.LogRecord_Constructors*
15 |java.util.logging.LogRecord(Level,String)|Construct a LogRecord with the given
17 *java.util.logging.LogRecord_Methods*
18 |java.util.logging.LogRecord.getLevel()|Get the logging message level, for exam
19 |java.util.logging.LogRecord.getLoggerName()|Get the source Logger name's
20 |java.util.logging.LogRecord.getMessage()|Get the "raw" log message, before loc
21 |java.util.logging.LogRecord.getMillis()|Get event time in milliseconds since 1
22 |java.util.logging.LogRecord.getParameters()|Get the parameters to the log mess
23 |java.util.logging.LogRecord.getResourceBundle()|Get the localization resource
24 |java.util.logging.LogRecord.getResourceBundleName()|Get the localization resou
25 |java.util.logging.LogRecord.getSequenceNumber()|Get the sequence number.
26 |java.util.logging.LogRecord.getSourceClassName()|Get the name of the class th
27 |java.util.logging.LogRecord.getSourceMethodName()|Get the name of the method
28 |java.util.logging.LogRecord.getThreadID()|Get an identifier for the thread whe
29 |java.util.logging.LogRecord.getThrown()|Get any throwable associated with the
30 |java.util.logging.LogRecord.setLevel(Level)|Set the logging message level, for
31 |java.util.logging.LogRecord.setLoggerName(String)|Set the source Logger name.
32 |java.util.logging.LogRecord.setMessage(String)|Set the "raw" log message, befo
33 |java.util.logging.LogRecord.setMillis(long)|Set event time.
34 |java.util.logging.LogRecord.setParameters(Object[])|Set the parameters to the
35 |java.util.logging.LogRecord.setResourceBundle(ResourceBundle)|Set the localiza
36 |java.util.logging.LogRecord.setResourceBundleName(String)|Set the localization
37 |java.util.logging.LogRecord.setSequenceNumber(long)|Set the sequence number.
38 |java.util.logging.LogRecord.setSourceClassName(String)|Set the name of the cla
39 |java.util.logging.LogRecord.setSourceMethodName(String)|Set the name of the me
40 |java.util.logging.LogRecord.setThreadID(int)|Set an identifier for the thread
41 |java.util.logging.LogRecord.setThrown(Throwable)|Set a throwable associated wi
43 *java.util.logging.LogRecord_Description*
45 LogRecord objects are used to pass logging requests between the logging
46 framework and individual log Handlers.
48 When a LogRecord is passed into the logging framework it logically belongs to
49 the framework and should no longer be used or updated by the client
52 Note that if the client application has not specified an explicit source method
53 name and source class name, then the LogRecord class will infer them
54 automatically when they are first accessed (due to a call on
55 getSourceMethodName or getSourceClassName) by analyzing the call stack.
56 Therefore, if a logging Handler wants to pass off a LogRecord to another
57 thread, or to transmit it over RMI, and if it wishes to subsequently obtain
58 method name or class name information it should call one of getSourceClassName
59 or getSourceMethodName to force the values to be filled in.
63 The LogRecord class is serializable.
65 Because objects in the parameters array may not be serializable, during
66 serialization all objects in the parameters array are written as the
67 corresponding Strings (using Object.toString).
69 The ResourceBundle is not transmitted as part of the serialized form, but the
70 resource bundle name is, and the recipient object's readObject method will
71 attempt to locate a suitable resource bundle.
76 *java.util.logging.LogRecord(Level,String)*
79 java.util.logging.Level level,
82 Construct a LogRecord with the given level and message values.
84 The sequence property will be initialized with a new unique value. These
85 sequence values are allocated in increasing order within a VM.
87 The millis property will be initialized to the current time.
89 The thread ID property will be initialized with a unique ID for the current
92 All other properties will be initialized to "null".
94 level - a logging level value
95 msg - the raw non-localized logging message (may be null)
97 *java.util.logging.LogRecord.getLevel()*
99 public |java.util.logging.Level| getLevel()
101 Get the logging message level, for example Level.SEVERE.
104 Returns: the logging message level
105 *java.util.logging.LogRecord.getLoggerName()*
107 public |java.lang.String| getLoggerName()
109 Get the source Logger name's
112 Returns: source logger name (may be null)
113 *java.util.logging.LogRecord.getMessage()*
115 public |java.lang.String| getMessage()
117 Get the "raw" log message, before localization or formatting.
119 May be null, which is equivalent to the empty string "".
121 This message may be either the final text or a localization key.
123 During formatting, if the source logger has a localization ResourceBundle and
124 if that ResourceBundle has an entry for this message string, then the message
125 string is replaced with the localized value.
128 Returns: the raw message string
129 *java.util.logging.LogRecord.getMillis()*
131 public long getMillis()
133 Get event time in milliseconds since 1970.
136 Returns: event time in millis since 1970
137 *java.util.logging.LogRecord.getParameters()*
139 public |java.lang.Object| getParameters()
141 Get the parameters to the log message.
144 Returns: the log message parameters. May be null if there are no parameters.
145 *java.util.logging.LogRecord.getResourceBundle()*
147 public |java.util.ResourceBundle| getResourceBundle()
149 Get the localization resource bundle
151 This is the ResourceBundle that should be used to localize the message string
152 before formatting it. The result may be null if the message is not localizable,
153 or if no suitable ResourceBundle is available.
156 *java.util.logging.LogRecord.getResourceBundleName()*
158 public |java.lang.String| getResourceBundleName()
160 Get the localization resource bundle name
162 This is the name for the ResourceBundle that should be used to localize the
163 message string before formatting it. The result may be null if the message is
167 *java.util.logging.LogRecord.getSequenceNumber()*
169 public long getSequenceNumber()
171 Get the sequence number.
173 Sequence numbers are normally assigned in the LogRecord constructor, which
174 assigns unique sequence numbers to each new LogRecord in increasing order.
177 Returns: the sequence number
178 *java.util.logging.LogRecord.getSourceClassName()*
180 public |java.lang.String| getSourceClassName()
182 Get the name of the class that (allegedly) issued the logging request.
184 Note that this sourceClassName is not verified and may be spoofed. This
185 information may either have been provided as part of the logging call, or it
186 may have been inferred automatically by the logging framework. In the latter
187 case, the information may only be approximate and may in fact describe an
188 earlier call on the stack frame.
190 May be null if no information could be obtained.
193 Returns: the source class name
194 *java.util.logging.LogRecord.getSourceMethodName()*
196 public |java.lang.String| getSourceMethodName()
198 Get the name of the method that (allegedly) issued the logging request.
200 Note that this sourceMethodName is not verified and may be spoofed. This
201 information may either have been provided as part of the logging call, or it
202 may have been inferred automatically by the logging framework. In the latter
203 case, the information may only be approximate and may in fact describe an
204 earlier call on the stack frame.
206 May be null if no information could be obtained.
209 Returns: the source method name
210 *java.util.logging.LogRecord.getThreadID()*
212 public int getThreadID()
214 Get an identifier for the thread where the message originated.
216 This is a thread identifier within the Java VM and may or may not map to any
221 *java.util.logging.LogRecord.getThrown()*
223 public |java.lang.Throwable| getThrown()
225 Get any throwable associated with the log record.
227 If the event involved an exception, this will be the exception object.
232 *java.util.logging.LogRecord.setLevel(Level)*
234 public void setLevel(java.util.logging.Level level)
236 Set the logging message level, for example Level.SEVERE.
238 level - the logging message level
240 *java.util.logging.LogRecord.setLoggerName(String)*
242 public void setLoggerName(java.lang.String name)
244 Set the source Logger name.
246 name - the source logger name (may be null)
248 *java.util.logging.LogRecord.setMessage(String)*
250 public void setMessage(java.lang.String message)
252 Set the "raw" log message, before localization or formatting.
254 message - the raw message string (may be null)
256 *java.util.logging.LogRecord.setMillis(long)*
258 public void setMillis(long millis)
262 millis - event time in millis since 1970
264 *java.util.logging.LogRecord.setParameters(Object[])*
266 public void setParameters(java.lang.Object[] parameters)
268 Set the parameters to the log message.
270 parameters - the log message parameters. (may be null)
272 *java.util.logging.LogRecord.setResourceBundle(ResourceBundle)*
274 public void setResourceBundle(java.util.ResourceBundle bundle)
276 Set the localization resource bundle.
278 bundle - localization bundle (may be null)
280 *java.util.logging.LogRecord.setResourceBundleName(String)*
282 public void setResourceBundleName(java.lang.String name)
284 Set the localization resource bundle name.
286 name - localization bundle name (may be null)
288 *java.util.logging.LogRecord.setSequenceNumber(long)*
290 public void setSequenceNumber(long seq)
292 Set the sequence number.
294 Sequence numbers are normally assigned in the LogRecord constructor, so it
295 should not normally be necessary to use this method.
298 *java.util.logging.LogRecord.setSourceClassName(String)*
300 public void setSourceClassName(java.lang.String sourceClassName)
302 Set the name of the class that (allegedly) issued the logging request.
304 sourceClassName - the source class name (may be null)
306 *java.util.logging.LogRecord.setSourceMethodName(String)*
308 public void setSourceMethodName(java.lang.String sourceMethodName)
310 Set the name of the method that (allegedly) issued the logging request.
312 sourceMethodName - the source method name (may be null)
314 *java.util.logging.LogRecord.setThreadID(int)*
316 public void setThreadID(int threadID)
318 Set an identifier for the thread where the message originated.
320 threadID - the thread ID
322 *java.util.logging.LogRecord.setThrown(Throwable)*
324 public void setThrown(java.lang.Throwable thrown)
326 Set a throwable associated with the log event.
328 thrown - a throwable (may be null)