Java SDK 1.4 Logging API - Core Objects
Return to the Java Programming Corner.
The Java 1.4 Logging API consistes of several classes that are responsible for capturing logging information, process and publish the intended logging information to any preferred destination. The following is a list of the core classes that make up the logging API:
java.util.logging.LogManagerclass is a singleton that is responsible for managing the logger namespace hierarchy. This class reads a system-wide configuration file to set the initial properties for the logging framework. Remember that a singleton is a class that is available only once per Java Virtual Manager (JVM) instance of an application.
java.util.logging.Loggerclass is responsible for carrying out the logging activity. This class provides several logging methods to publish logging information.
java.util.logging.LogRecordclass encapsulates all the logging information. Typically, it contains header information for the message like: the date and timestamp of the logging message, the origin of the logging activity, and the granularity and priority level of the logging message.
java.util.logging.Handlerclass is responsible for publishing logging information to various destinations - a file, console, memory buffers, etc.
java.util.logging.Filterclass is used by
Loggerobjects to decide whether logging information should be passed to a
Handlerto deal with it or simply be ignored.
Handlerobjects can also use
Filterobjects to perform more checks on a logging request before publishing them to the final destination.
java.util.logging.Formatterclass is responsible for providing required structure to the logging information being published. Formatters also perform the localization of logging information, if configured to do so.