Feature request: Native Json Logs


Would be nice to be able to select from a range of logging formats, example:

  • plain text
  • json lines

Using json lines for logging, allows to group that plain text stacktrace into a json array, and therefore:

  • reducing the complexity of reading logs when multiple threads/process are logging
  • keeps the log tag together with all those stack trace lines (ex: request_id)

There are some gems out there to do it, such as https://logger.rocketjob.io. This implementation also has the notion of named tags, which is super nice.

In my option, it would be amazing if customizing the rails logging output format would be part of the core rails. Is anyone else also using json logs? What libraries do you use? Do you feel the same as I do?