You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Several modern services output their container logs as JSON objects, where each line is a self-contained JSON record {...}
This makes it easier to parse or process the output using other tools, but it makes it harder to visually read the data.
Describe the solution you'd like
I think that adding a Javascript syntax highlighting plugin like Prism would go a long way towards making container logs more readable. I also think that a simple Regexp test can detect whether the logs contain JSON objects (one per line) or not. If they don't, Prism can be disabled, or maybe started with the generic log syntax support.
Describe alternatives you've considered
I thought about suggesting one of the JSON tree browsing plugins (those that use ⊞ and ⊟ or ▷ and ▽ buttons to expand parts of the JSON objects. But then I realized that it would make the log viewer window much more complicated and hard to use, especially when copy-pasting the log data. A simple syntax highlighter should solve the legibility issue, be lightweight enough, and not disrupt the copy-paste function.
Additional context
Here is a screenshot showing how JSON logs are somewhat hard to read:
This discussion was converted from issue #5442 on July 27, 2023 04:34.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Several modern services output their container logs as JSON objects, where each line is a self-contained JSON record
{...}This makes it easier to parse or process the output using other tools, but it makes it harder to visually read the data.
Describe the solution you'd like
I think that adding a Javascript syntax highlighting plugin like Prism would go a long way towards making container logs more readable. I also think that a simple Regexp test can detect whether the logs contain JSON objects (one per line) or not. If they don't, Prism can be disabled, or maybe started with the generic
logsyntax support.Describe alternatives you've considered
I thought about suggesting one of the JSON tree browsing plugins (those that use ⊞ and ⊟ or ▷ and ▽ buttons to expand parts of the JSON objects. But then I realized that it would make the log viewer window much more complicated and hard to use, especially when copy-pasting the log data. A simple syntax highlighter should solve the legibility issue, be lightweight enough, and not disrupt the copy-paste function.
Additional context

Here is a screenshot showing how JSON logs are somewhat hard to read:
Beta Was this translation helpful? Give feedback.
All reactions