Name
Package java.util.logging
Synopsis
The java.util.logging
package defines a sophisticated and
highly-configurable logging facility that Java applications can use
to emit, filter, format, and output warning, diagnostic, tracing and
debugging messages. An application generates log messages by calling
various methods of a Logger object. The content of
a log message (with other pertinant details such as the time and
sequence number) is encapsulated in a LogRecord
object generated by the Logger. A
Handler object represents a destination for
LogRecord objects. Concrete subclasses of
Handler support destinations such as files and
sockets. Most Handler objects have an associated
Formatter that converts a
LogRecord object into the actual text that is
logged. The subclasses SimpleFormatter and
XMLFormatter produce simple plain-text log
messages and detailed XML logs respectively.
Each log message has an associated severity level. The
Level class defines a type-safe enumeration of
defined levels. Logger and
Handler objects both have an associated
Level, and discard any log messages whose severity
is less than that specified level. In addition to this level-based
filtering, Logger and Handler
objects may also have an associated Filter object
which may be implemented to filter log messages based on any desired
criteria.
Applications that desire complete control over the logs they generate
can create a Logger object, along with
Handler, Formatter and
Filter objects that control the destination, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access