java.lang.Object
java.util.logging.Formatter
org.glassfish.main.jul.formatter.GlassFishLogFormatter
org.glassfish.main.jul.formatter.OneLineFormatter
Fast
Formatter usable in tests or even in production if you need only simple logs with
time, level and messages.
Note that if you configured the formatter from your code (and not a property file),
if you want to source class and method automatically detected, you have to enable
GlassFishLoggingConstants.KEY_CLASS_AND_METHOD_DETECTION_ENABLED. Without that the output
will contain just class and method fields manually set to the LogRecord or using Logger
methods which have these parameters to do that.
- Author:
- David Matejcek
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumConfiguration property set of this formatterNested classes/interfaces inherited from class org.glassfish.main.jul.formatter.GlassFishLogFormatter
GlassFishLogFormatter.GlassFishLogFormatterProperty -
Field Summary
Fields inherited from class org.glassfish.main.jul.formatter.GlassFishLogFormatter
DEFAULT_DATETIME_FORMATTER, ISO_LOCAL_DATE_TIME, ISO_LOCAL_TIME, MSG_RESOLVER -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance and initializes defaults from log manager's configurationOneLineFormatter(HandlerId handlerId) Creates formatter with default time format if not set otherwise in the logging configuration. -
Method Summary
Modifier and TypeMethodDescriptionformatMessage(LogRecord record) formatRecord(LogRecord record) Formats the record.Methods inherited from class org.glassfish.main.jul.formatter.GlassFishLogFormatter
format, getPrintedMessage, getTimestampFormatter, isPrintSequenceNumber, isPrintSource, setPrintSequenceNumber, setPrintSource, setTimestampFormatter, setTimestampFormatter
-
Constructor Details
-
OneLineFormatter
Creates formatter with default time format if not set otherwise in the logging configuration.- Parameters:
handlerId-
-
OneLineFormatter
public OneLineFormatter()Creates an instance and initializes defaults from log manager's configuration
-
-
Method Details
-
formatRecord
Description copied from class:GlassFishLogFormatterFormats the record.- Specified by:
formatRecordin classGlassFishLogFormatter- Returns:
- formatted record, final record for output
-
formatMessage
- Overrides:
formatMessagein classGlassFishLogFormatter
-