Class PseudoIsoSimpleFormatter
- java.lang.Object
-
- java.util.logging.Formatter
-
- java.util.logging.SimpleFormatter
-
- de.aristaflow.adept2.base.registry.PseudoIsoSimpleFormatter
-
public class PseudoIsoSimpleFormatter extends SimpleFormatter
This formats log entries similar toSimpleFormatter
except that it uses a pseudo ISO format for the timestamp instead of a datetime format using the default locale of the JVM.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
formatString
The format string for thisSimpleFormatter
.protected static String
JUL_FORMAT_PROP_KEY
jdk.internal.logger.SimpleConsoleLogger.Formatting#JUL_FORMAT_PROP_KEY
protected TimeZone
timeZone
The (default) timezone used for log entry timestamps.
-
Constructor Summary
Constructors Constructor Description PseudoIsoSimpleFormatter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format(LogRecord record)
This uses the local time formatted as pseudo-ISO (if not re-configured) timestamp of the log entry.protected static String
getFormat()
Gets the format string to use with thisSimpleFormatter
.-
Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
-
-
-
-
Field Detail
-
JUL_FORMAT_PROP_KEY
protected static final String JUL_FORMAT_PROP_KEY
jdk.internal.logger.SimpleConsoleLogger.Formatting#JUL_FORMAT_PROP_KEY
- See Also:
- Constant Field Values
-
timeZone
protected final TimeZone timeZone
The (default) timezone used for log entry timestamps.
-
formatString
protected final String formatString
The format string for thisSimpleFormatter
.
-
-
Method Detail
-
getFormat
protected static String getFormat()
Gets the format string to use with thisSimpleFormatter
. This copies the logic implemented inSimpleFormatter
as close as possible. It will be slightly different since it cannot access the internal classes used bySimpleFormatter
.First the format string is retrieved as system property using
JUL_FORMAT_PROP_KEY
. If this yields no format string, theLogManager
is asked for the corresponding property. If this yields no format string either, the (copied) defaultjdk.internal.logger.SimpleConsoleLogger.Formatting#DEFAULT_FORMAT
will be used except for the time whereDateTimeFormatter.ISO_OFFSET_DATE_TIME
will be used but printing the name of the current default timezone instead of the corresponding offset.- Returns:
- The format string used for each log entry.
-
format
public String format(LogRecord record)
This uses the local time formatted as pseudo-ISO (if not re-configured) timestamp of the log entry.- Overrides:
format
in classSimpleFormatter
-
-