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.
77 *java.util.logging.LogRecord(Level,String)*
80 java.util.logging.Level level,
83 Construct a LogRecord with the given level and message values.
85 The sequence property will be initialized with a new unique value. These
86 sequence values are allocated in increasing order within a VM.
88 The millis property will be initialized to the current time.
90 The thread ID property will be initialized with a unique ID for the current
93 All other properties will be initialized to "null".
95 level - a logging level value
96 msg - the raw non-localized logging message (may be null)
98 *java.util.logging.LogRecord.getLevel()*
100 public |java.util.logging.Level| getLevel()
102 Get the logging message level, for example Level.SEVERE.
106 Returns: the logging message level
108 *java.util.logging.LogRecord.getLoggerName()*
110 public |java.lang.String| getLoggerName()
112 Get the source Logger name's
116 Returns: source logger name (may be null)
118 *java.util.logging.LogRecord.getMessage()*
120 public |java.lang.String| getMessage()
122 Get the "raw" log message, before localization or formatting.
124 May be null, which is equivalent to the empty string "".
126 This message may be either the final text or a localization key.
128 During formatting, if the source logger has a localization ResourceBundle and
129 if that ResourceBundle has an entry for this message string, then the message
130 string is replaced with the localized value.
134 Returns: the raw message string
136 *java.util.logging.LogRecord.getMillis()*
138 public long getMillis()
140 Get event time in milliseconds since 1970.
144 Returns: event time in millis since 1970
146 *java.util.logging.LogRecord.getParameters()*
148 public |java.lang.Object|[] getParameters()
150 Get the parameters to the log message.
154 Returns: the log message parameters. May be null if there are no parameters.
156 *java.util.logging.LogRecord.getResourceBundle()*
158 public |java.util.ResourceBundle| getResourceBundle()
160 Get the localization resource bundle
162 This is the ResourceBundle that should be used to localize the message string
163 before formatting it. The result may be null if the message is not localizable,
164 or if no suitable ResourceBundle is available.
168 *java.util.logging.LogRecord.getResourceBundleName()*
170 public |java.lang.String| getResourceBundleName()
172 Get the localization resource bundle name
174 This is the name for the ResourceBundle that should be used to localize the
175 message string before formatting it. The result may be null if the message is
180 *java.util.logging.LogRecord.getSequenceNumber()*
182 public long getSequenceNumber()
184 Get the sequence number.
186 Sequence numbers are normally assigned in the LogRecord constructor, which
187 assigns unique sequence numbers to each new LogRecord in increasing order.
191 Returns: the sequence number
193 *java.util.logging.LogRecord.getSourceClassName()*
195 public |java.lang.String| getSourceClassName()
197 Get the name of the class that (allegedly) issued the logging request.
199 Note that this sourceClassName is not verified and may be spoofed. This
200 information may either have been provided as part of the logging call, or it
201 may have been inferred automatically by the logging framework. In the latter
202 case, the information may only be approximate and may in fact describe an
203 earlier call on the stack frame.
205 May be null if no information could be obtained.
209 Returns: the source class name
211 *java.util.logging.LogRecord.getSourceMethodName()*
213 public |java.lang.String| getSourceMethodName()
215 Get the name of the method that (allegedly) issued the logging request.
217 Note that this sourceMethodName is not verified and may be spoofed. This
218 information may either have been provided as part of the logging call, or it
219 may have been inferred automatically by the logging framework. In the latter
220 case, the information may only be approximate and may in fact describe an
221 earlier call on the stack frame.
223 May be null if no information could be obtained.
227 Returns: the source method name
229 *java.util.logging.LogRecord.getThreadID()*
231 public int getThreadID()
233 Get an identifier for the thread where the message originated.
235 This is a thread identifier within the Java VM and may or may not map to any
242 *java.util.logging.LogRecord.getThrown()*
244 public |java.lang.Throwable| getThrown()
246 Get any throwable associated with the log record.
248 If the event involved an exception, this will be the exception object.
255 *java.util.logging.LogRecord.setLevel(Level)*
257 public void setLevel(java.util.logging.Level level)
259 Set the logging message level, for example Level.SEVERE.
262 level - the logging message level
264 *java.util.logging.LogRecord.setLoggerName(String)*
266 public void setLoggerName(java.lang.String name)
268 Set the source Logger name.
271 name - the source logger name (may be null)
273 *java.util.logging.LogRecord.setMessage(String)*
275 public void setMessage(java.lang.String message)
277 Set the "raw" log message, before localization or formatting.
280 message - the raw message string (may be null)
282 *java.util.logging.LogRecord.setMillis(long)*
284 public void setMillis(long millis)
289 millis - event time in millis since 1970
291 *java.util.logging.LogRecord.setParameters(Object[])*
293 public void setParameters(java.lang.Object[] parameters)
295 Set the parameters to the log message.
298 parameters - the log message parameters. (may be null)
300 *java.util.logging.LogRecord.setResourceBundle(ResourceBundle)*
302 public void setResourceBundle(java.util.ResourceBundle bundle)
304 Set the localization resource bundle.
307 bundle - localization bundle (may be null)
309 *java.util.logging.LogRecord.setResourceBundleName(String)*
311 public void setResourceBundleName(java.lang.String name)
313 Set the localization resource bundle name.
316 name - localization bundle name (may be null)
318 *java.util.logging.LogRecord.setSequenceNumber(long)*
320 public void setSequenceNumber(long seq)
322 Set the sequence number.
324 Sequence numbers are normally assigned in the LogRecord constructor, so it
325 should not normally be necessary to use this method.
329 *java.util.logging.LogRecord.setSourceClassName(String)*
331 public void setSourceClassName(java.lang.String sourceClassName)
333 Set the name of the class that (allegedly) issued the logging request.
336 sourceClassName - the source class name (may be null)
338 *java.util.logging.LogRecord.setSourceMethodName(String)*
340 public void setSourceMethodName(java.lang.String sourceMethodName)
342 Set the name of the method that (allegedly) issued the logging request.
345 sourceMethodName - the source method name (may be null)
347 *java.util.logging.LogRecord.setThreadID(int)*
349 public void setThreadID(int threadID)
351 Set an identifier for the thread where the message originated.
354 threadID - the thread ID
356 *java.util.logging.LogRecord.setThrown(Throwable)*
358 public void setThrown(java.lang.Throwable thrown)
360 Set a throwable associated with the log event.
363 thrown - a throwable (may be null)