Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

junhaoliao
Copy link
Member

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

@junhaoliao junhaoliao changed the title new-log-viewer: do not format date if no date pattern is specified in configured format string. new-log-viewer: do not format date if no date pattern is specified in format string. Aug 16, 2024
@junhaoliao junhaoliao changed the title new-log-viewer: do not format date if no date pattern is specified in format string. new-log-viewer: LogbackFormatter: do not format date if no date pattern is specified in format string. Aug 16, 2024
Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the PR title, how about:

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

@junhaoliao junhaoliao changed the title new-log-viewer: LogbackFormatter: do not format date if no date pattern is specified in format string. new-log-viewer: LogbackFormatter: Only insert timestamp if date pattern was specified. Aug 16, 2024
@junhaoliao junhaoliao merged commit adc313a into y-scope:main Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants