Pretty JSON Log plugin
Pretty JSON Log plugin for IntelliJ Platform makes NDJSON (Newline Delimited JSON a.k.a. JSON Lines) logs more readable
in the console. It has the following features:
- JSON Parsing: Automatically parses each log line as JSON and extracts essential log information such as timestamp,
log level, and message. - Colorful Display: Displays essential log information in different colors depending on the log level to make it
easier to read. - Readable Timestamp: Formats the timestamp in a human-friendly format.
- Expandable Pretty JSON: Prints a well-formatted JSON string following the log message. The JSON string is folded
by default, but you can expand it when you need to view the full details. - Seamless Integration: Supports various log formats such
as Logstash, Bunyan,
Pino, log/slog,
Cloud Logging, etc. with no additional configuration or
software.
This plugin is useful when you are developing a modern system that outputs logs in JSON format. You no longer need to
switch log formats between production and local development environments.
Installation
-
Using the IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "Pretty JSON
Log" > Install -
Manually:
Download the latest release and install it
manually using
Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
After installation, newly written JSON lines logs in the console will be automatically formatted by the plugin.
Limitations
JetBrains IDEs provide different kinds of consoles for different run configurations, but this plugin does not currently
support all consoles due
to the lack of extension points in the IDE.
If the console does not have the context menu item "Pretty JSON Log", the plugin is not supported in that console.
How to configure log colors
You can configure log colors from the Settings > Editor > Color Scheme > Console
Colors > Log console.
How to see the debug log of the plugin
- Help > Diagnostic Tools > Debug Log Settings....
- Add line
#io.github.orangain.prettyjsonlogto the text area of the dialog and click OK. - Reproduce the issue.
- Help > Show Log in Finder/Explorer to open the log directory.
- Open the
idea.logfile and find the log of the plugin by searching for#io.github.orangain.prettyjsonlog.
Enabling debug logging may slow down the IDE, so it is recommended to disable it after reproducing the issue.
Acknowledgements
This plugin is inspired by the pino-pretty
and bunyan CLI. The great idea behind these tools is that applications should
write logs in machine-readable format (JSON) and pretty-printing for human readability should be done by another tool. I
am grateful to the authors of these tools.
Thanks to the IntelliJ Platform Plugin Template, I was able to quickly start developing the plugin.
Internal
How to release
- Human: Add change logs to
CHANGELOG.mdunder the[Unreleased]section. (This step can be done when making changes.) - Human: Update
pluginVersioningradle.propertiesand merge it into the main branch. - CI/CD workflow: Create a GitHub release draft for the new version automatically.
- Human: Publish the release note.
- CI/CD workflow: Start deployment workflow automatically, but it will wait for human approval.
- Human: Approve deployment in Actions page.
- CI/CD workflow: Deploy the new version to JetBrains Marketplace and create a PR to update CHANGELOG.md.
- Human: Merge the PR to update
CHANGELOG.md. - JetBrains: The new version will be reviewed by JetBrains and if there are no problems, it will be published in Marketplace.



