- All Superinterfaces:
- LogFormatter
- All Known Implementing Classes:
- LogFormatter.NoopFormatter
- Enclosing interface:
- LogFormatter
public static sealed interface LogFormatter.TimestampFormatter
extends LogFormatter
permits LogFormatter.NoopFormatter (not exhaustive)
Formats event timestamps.
- 
Nested Class SummaryNested classes/interfaces inherited from interface io.jstach.rainbowgum.LogFormatterLogFormatter.Builder, LogFormatter.EventFormatter, LogFormatter.LevelFormatter, LogFormatter.NoopFormatter, LogFormatter.StaticFormatter, LogFormatter.ThrowableFormatter, LogFormatter.TimestampFormatter
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe default timestamp format used in many logging frameworks which does not have dates and only time at millisecond precision.
- 
Method SummaryModifier and TypeMethodDescriptiondefault voidformat(StringBuilder output, LogEvent event) Formats a log event.voidformatTimestamp(StringBuilder output, Instant instant) Format timestamp.of()Formats timestamp usingTTLL_TIME_FORMAT.of(DateTimeFormatter dateTimeFormatter) Formats a timestamp using standard JDK date time formatter.ofISO()Formats a timestamp using ISO format.ofMicros()Micro seconds over the events last second.Methods inherited from interface io.jstach.rainbowgum.LogFormatterisNoop
- 
Field Details- 
TTLL_TIME_FORMATThe default timestamp format used in many logging frameworks which does not have dates and only time at millisecond precision.It is called TTLL as that is the name of the format where it is used in logback, log4j etc. - See Also:
 
 
- 
- 
Method Details- 
formatTimestampFormat timestamp.- Parameters:
- output- buffer.
- instant- timestamp.
 
- 
formatDescription copied from interface:LogFormatterFormats a log event.- Specified by:
- formatin interface- LogFormatter
- Parameters:
- output- buffer.
- event- log event.
- See Also:
 
- 
ofFormats timestamp usingTTLL_TIME_FORMAT.- Returns:
- formatter.
 
- 
ofISOFormats a timestamp using ISO format.- Returns:
- formatter.
 
- 
ofMicrosMicro seconds over the events last second. This is for logback compatibility.- Returns:
- microseconds zero padded.
 
- 
ofFormats a timestamp using standard JDK date time formatter.- Parameters:
- dateTimeFormatter- date time formatter.
- Returns:
- timestamp formatter.
 
 
-