Datasheet

Method Description
void setThreadID (int threadID) Sets the identifier of the thread where the log mes-
sage is originating.
void setThrown (Throwable thrown) Sets a Throwable to associate with the log message.
Can be null.
Resource Bundle Methods
The following methods allow you to retrieve and configure a resource bundle for use with the log mes-
sage. Resource bundles are used for localizing log messages.
Method Description
ResourceBundle getResourceBundle() Returns the ResourceBundle associated with the
logger that is used to localize log messages. Might be
null if there is no associated
ResourceBundle.
String getResourceBundleName() Returns the name of the resource bundle used to
localize log messages. Returns null if log messages
are not localizable (no resource bundle defined).
void setResourceBundle Sets a resource bundle to use to localize log
(ResourceBundle bundle) messages.
void setResourceBundleName(String Sets the name of a resource bundle to use to localize
name) log messages.
Setting Information about the Message
The following methods configure the log message itself. Some of the information you can configure
related to the log message are its level, the contents of the message, and the time the message was sent.
Method Description
void setLevel(Level level) Sets the level of the logging message.
void setLoggerName(String name) Sets the name of the logger issuing this message. Can
be null.
void setMessage(String message) Sets the contents of the message before formatting/
localization.
void setMillis(long millis) Sets the time of the log message, in milliseconds,
since 1970.
void setParameters(Object[] Sets parameters for the log message.
parameters)
44
Part I: Thinking Like a Java Developer
05_777106 ch01.qxp 11/28/06 10:43 PM Page 44