Datasheet

Events
The methods listed in the following table provide a way to add and remove references to listeners that
should be notified when properties are changed on the
LogManager.
Method Description
void addPropertyChangeListener Adds a property change listener to the list of listeners
(PropertyChangeListener l) that want notification of when a property has
changed. The same listener can be added multiple
times.
void removePropertyChangeListener Removes a single occurrence of a property change
(PropertyChangeListener l) listener in the list of listeners.
The Logger Class
An instance of the Logger class is used by client code to log a message. Both the log message and each
logger have an associated level. If the level of the log message is equal to or greater than the level of the
logger, the message is then processed. Otherwise, the logger drops the log message. It is an inexpensive
operation to test whether or not to drop the log message, and this operation is done at the entry point to
the logging system the
Logger class. These levels are defined inside the Level class. Consult the fol-
lowing table for a full list of levels.
Logger Level Description
SEVERE Highest logging level. This has top priority.
WARNING One level below severe. Intended for warning
messages that need attention, but aren’t serious.
INFO Two levels below severe. Intended for informational
messages.
CONFIG Three levels below severe. Intended for configuration-
related output.
FINE Four levels below severe. Intended for program
tracing information.
FINER Five levels below severe. Intended for program
tracing information.
FINEST Lowest logging level. This has lowest priority.
ALL Special level that makes the system log ALL messages.
OFF Special level that makes the system log NO messages
(turns logging off completely).
38
Part I: Thinking Like a Java Developer
05_777106 ch01.qxp 11/28/06 10:43 PM Page 38