public class CentralLogFormatter
extends java.util.logging.Formatter
FileHandler. Exposes portions of the formatting
logic to be reused by other formatters or directly by the CentralLogger. Provides a parse method to
convert back formatted text into CentralLogRecord.| Modifier and Type | Field and Description |
|---|---|
private static java.text.SimpleDateFormat |
DATETIME_FORMATTER
The datetime formatter used for each log record.
|
private static java.lang.String |
LINE_SEPARATOR
The line separator for the operating system.
|
(package private) static java.lang.String |
LOG_PARTS_DIVIDER
The divider between different parts of the log message.
|
| Constructor and Description |
|---|
CentralLogFormatter() |
| Modifier and Type | Method and Description |
|---|---|
protected static ContextLogRecord.LogContext |
describeContext(java.lang.Integer sessionId,
java.lang.String userId,
boolean excludeSMContext)
Get a string which uniquely describes the current context.
|
(package private) static void |
dumpMessage(java.lang.StringBuilder sb,
java.util.logging.LogRecord record)
Appends the log message to the string builder.
|
(package private) static void |
dumpThrowable(java.lang.StringBuilder sb,
java.lang.Throwable original)
Dump all details of the throwable into the given string buffer.
|
java.lang.String |
format(java.util.logging.LogRecord record)
Transforms the log record to string.
|
(package private) static CentralLogRecord |
parse(java.lang.String logLine)
Convert back formatted text into CentralLogRecord.
|
static final java.lang.String LOG_PARTS_DIVIDER
private static final java.text.SimpleDateFormat DATETIME_FORMATTER
private static final java.lang.String LINE_SEPARATOR
protected static ContextLogRecord.LogContext describeContext(java.lang.Integer sessionId, java.lang.String userId, boolean excludeSMContext)
sessionId - The remote server session ID.userId - The remote server user ID.excludeSMContext - Flag to prevent deadlock on SecurityManager, ref #5703#note-77.static CentralLogRecord parse(java.lang.String logLine)
logLine - The formatted log.static void dumpThrowable(java.lang.StringBuilder sb,
java.lang.Throwable original)
sb - The string builder the throwable to be appended to.original - The throwable to dump.static void dumpMessage(java.lang.StringBuilder sb,
java.util.logging.LogRecord record)
sb - The string builder the message to be appended to.record - The log record with the message or the message format and parameters.public java.lang.String format(java.util.logging.LogRecord record)
format in class java.util.logging.Formatterrecord - The log record.