@ThreadSafe 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
,
DxFeedPatternLayout
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 levelChar,
long time,
String threadName,
String loggerName,
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 levelChar, long time, String threadName, String loggerName, String msg)
NullPointerException
- when threadName, loggerName, or msg are null
.Copyright © 2002–2025 Devexperts LLC. All rights reserved.