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:
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.
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.
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.
#io.github.orangain.prettyjsonlog
to the text area of the dialog and click OK.idea.log
file 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.
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.