Datasheet

Method Description
void setParent(Logger parent) Sets the parent for this logger. This should not
be called by application code, because it is
intended for use only by the logging system.
void setUseParentHandlers(boolean Specifies true if log messages should be passed
useParentHandlers) to their parent loggers, or false to prevent the
log messages from passing to their parent.
Filter getFilter() Returns the filter for this logger, which might
be null if no filter is associated.
Handler[] getHandlers() Returns an array of all handlers associated
with this logger.
Level getLevel() Returns the log level assigned to this logger. If
null is returned, it indicates the logging level
of the parent logger that will be used.
String getName() Returns the name of this logger, or null if this
is an anonymous logger.
Logger getParent() The nearest parent to the current logger is
returned, or null if the current logger is the
root logger.
ResourceBundle getResourceBundle() Returns the ResourceBundle associated with
this logger. Resource bundles are used for
localization of log messages. If null is
returned, the resource bundle from the log-
ger’s parent will be used.
String getResourceBundleName() Returns the name of the resource bundle this
logger uses for localization, or null if the
resource bundle is inherited from the logger’s
parent.
boolean getUseParentHandlers() Returns true if log messages are passed to the
logger’s parent, or false if log messages are not
passed up the hierarchy.
Logging Messages
The following methods are all used to actually log a message using a Logger. Convenience methods are
provided for logging messages at each logging level, and also for entering and exiting methods and
throwing exceptions. Additional methods are provided to localize log messages using a resource bundle.
40
Part I: Thinking Like a Java Developer
05_777106 ch01.qxp 11/28/06 10:43 PM Page 40