Formatting logs in OS X Console

consoleformatting

We have logs from an application that are formatted as JSON. Normally they are sent to a central logging tool like LogStash. On the terminal, we can read them using a tool like jq. But if I attach a log file to a ticket or email it with a name ending in .log OS X opens it in Console by default. I am trying to find a straightforward way to view it formatted or pretty-printed within the Console application.

Best Answer

Check out this article: https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/LoggingErrorsAndWarnings.html

It looks like there isn't any way to nicely format JSON for the console app, but you might be able to use the tagging system for some increased clarity.

Probably a better idea to include instructions on how to open the log in a more capable program.