The Logging API
The java.util.logging package
provides a highly flexible and easy-to-use logging framework for system
information, error messages, and fine-grained tracing (debugging) output.
With the logging package, you can apply filters to select log messages,
direct their output to one or more destinations (including files and
network services), and format the messages appropriately for their
consumers.
Most importantly, much of this basic logging configuration can be set up externally at runtime through the use of a logging setup properties file or an external program. For example, by setting the right properties at runtime, you can specify that log messages are to be sent both to a designated file in XML format and also logged to the system console in a digested, human-readable form. Furthermore, for each of those destinations, you can specify the level or priority of messages to be logged, discarding those below a certain threshold of significance. By following the correct source conventions in your code, you can even make it possible to adjust the logging levels for specific parts of your application, allowing you to target individual packages and classes for detailed logging without being overwhelmed by too much output. The Logging API can even be controlled remotely via Java Management Extensions MBean APIs.
Overview
Any good logging API must have at least two guiding principles. First, performance should not inhibit the developer from using log messages freely. As with ...