Logging in Java
An Introduction |
Prof. David Bernstein
|
Computer Science Department |
bernstdh@jmu.edu |
java.util.logging
Logger
:
LogRecord
:
Handler
:
LogRecord
objects to a variety of
destinations including memory, output streams, consoles,
files, and socketsFilter
:
Formatter
:
LogRecord
objectsLogger
object.
Logger
creates a LogRecord
.
Logger
(perhaps after checking a log level and/or
Filter
) passes the LogRecord
to
a Handler
.
Handler
uses a Formatter
is used to
format the LogRecord
.
severe(String message)
warning(String message)
fine(String message)
finest(String message)
log(Level level, String message
entering()
exiting()
throwing()
ConsoleHandler
FileHandler
SocketHandler
SimpleFormatter
XMLFormatter