y-scope / yscope-log-viewer

A tool that can be used to view logs compressed in CLP's IR Stream format.
Apache License 2.0
9 stars 12 forks source link

new-log-viewer: LogbackFormatter: Only insert timestamp if date pattern was specified. #53

Closed junhaoliao closed 1 month ago

junhaoliao commented 1 month ago

References

46 added support for decoding JSONL files. One issue was found that when the "formatString" does not include a date pattern, the formatted message still include formatted dates.

Description

  1. Do not format date if no date pattern is specified in configured format string.

Validation performed

  1. Loaded Log Viewer with example jsonl file. image Screenshot showing the formatted messages with dates
  2. In config debug form, configured decoderOptions/formatString with value [%process.thread.name] %log.level %message%n, which is the default with the date pattern %d{yyyy-MM-dd HH:mm:ss.SSS} removed from the beginning.
  3. Applied the config. After the page was reloaded, observed that the formatted messages no longer includes dates. image Screenshot showing the formatted messages do not include dates because now no such is configured in decoderOptions/formatString