public class LogFormatter extends Formatter
java.util.logging
log messages.
Performs conversion of thread names according to patterns specified in configuration file.
If the system property logformatter.properties
is specified, then it should contain
an URL to the configuration file. Otherwise, configuration is loaded from classpath, using
/META-INF/logformatter.properties file.
The format of the file is:
System.err
.
Sample configuration file can be found in etc/logformatter.properties.
This class is not intended to be used standalone.
It is a part of implementation of com.devexperts.logging
package.
DetailedLogLayout
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_FILE_PROPERTY |
static String |
DEFAULT_CONFIG_FILE |
Constructor and Description |
---|
LogFormatter() |
LogFormatter(TimeZone zone) |
Modifier and Type | Method and Description |
---|---|
String |
format(char level_char,
long time,
String thread_name,
String logger_name,
String msg)
Formats log message.
|
String |
format(LogRecord record)
Used by
java.util.logging logging. |
formatMessage, getHead, getTail
public static final String CONFIG_FILE_PROPERTY
public static final String DEFAULT_CONFIG_FILE
public LogFormatter()
public LogFormatter(TimeZone zone)
public String format(LogRecord record)
java.util.logging
logging.
Formats messages with the same format as for log4j.public String format(char level_char, long time, String thread_name, String logger_name, String msg)
NullPointerException
- when thread_name, logger_name, or msg are null
.Copyright © 2014 Devexperts. All Rights Reserved.