Logs as json. Pretty straightforward, see tests for actual format of output.
This is great if you plan to parse logs programatically.
Add this line to your application's Gemfile:
gem 'json_logger_formatter'
And then execute:
$ bundle
Or install it yourself as:
$ gem install json_logger_formatter
l = Logger.new('path/to/log.file') # any valid log target
l.formatter = JsonLoggerFormatter::Formatter
l.info {whatever: 'you want to put here'}
- Fork it ( https://github.com/[my-github-username]/json_logger_formatter/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request