Logging is performed through JavaBeans events. To log a message, a component creates a LogEvent that includes the message, then broadcasts the event. Events are received by LogListener objects that handle the logging events in various ways. Some LogListener objects write events to a log file, some send e-mail, some dispatch events to multiple listeners. The separation between log source and log listener allows for a flexible logging configuration that can be tailored to individual applications.

A LogListener can be either a LogEvent sink (performs a final action) or a LogEvent filter (sends an event to other LogListeners). The following sections describe how to implement log events:

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices