public class LogFormatter extends Formatter
Formatter that uses a compact date and time format
that includes milliseconds, permits the date and time format to be
customized, and allows suppressing stack traces for exceptions.
This class recognizes the following LogManager configuration
properties:
Formatter.format to display the date and time of a
logging call. The argument to the format call will be a long
representing the current time in milliseconds. The default prints the
time in the format 2008-02-14 11:52:59.679.
true
For example, to use this class to format logging output to the console so that it prints the time in milliseconds since the epoch and does not include stack traces, put the following text in the logging configuration file:
.level = INFO handlers = java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.formatter = com.sun.sgs.impl.sharedutil.logging.LogFormatter com.sun.sgs.impl.sharedutil.logging.LogFormatter.time.format = %tQ com.sun.sgs.impl.sharedutil.logging.LogFormatter.print.stack = false
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_TIME_FORMAT
The default time format string.
|
static String |
PRINT_STACK_PROPERTY
The logging property for specifying whether to print stack traces when
logging a thrown exception.
|
static String |
TIME_FORMAT_PROPERTY
The logging property for specifying the time format.
|
| Constructor and Description |
|---|
LogFormatter()
Creates an instance of this class.
|
public static final String DEFAULT_TIME_FORMAT
public static final String TIME_FORMAT_PROPERTY
public static final String PRINT_STACK_PROPERTY
Copyright © 2007-2013. All Rights Reserved.