Datasheet

Method Description
void logp(Level level, String Take source class and source method names in
sourceClass, String sourceMethod, addition to the other information. All this is put into a
String msg) LogRecord object and sent into the system.
void logp(Level level, String
sourceClass, String sourceMethod,
String msg, Object param1)
void logp(Level level, String
sourceClass, String sourceMethod,
String msg, Object[] params)
void logp(Level level, String
sourceClass, String sourceMethod,
String msg, Throwable thrown)
void logrb(Level level, String
Allow you to specify a resource bundle in addition to
sourceClass, String sourceMethod, the other information. The resource bundle will be
String bundleName, String msg) used to localize the log message.
void logrb(Level level, String
sourceClass, String sourceMethod,
String bundleName, String msg,
Object param1)
void logrb(Level level, String
sourceClass, String sourceMethod,
String bundleName, String msg,
Object[] params)
void logrb(Level level, String
sourceClass, String sourceMethod,
String bundleName, String msg,
Throwable thrown)
void throwing(String sourceClass,
Logs a throwing message. The log level is
String sourceMethod, Throwable Level.FINER. The log record’s message is set to
thrown) THROW and the contents of thrown are put into the log
record’s
thrown property instead of inside the log
record’s message.
The LogRecord Class
The LogRecord class encapsulates a log message, carrying the message through the logging system.
Handlers and Formatters use LogRecords to have more information about the message (such as the
time it was sent and the logging level) for processing. If a client to the logging system has a reference to a
LogRecord object, the object should no longer be used after it is passed into the logging system.
42
Part I: Thinking Like a Java Developer
05_777106 ch01.qxp 11/28/06 10:43 PM Page 42