Simple decorator for standard logger to log in Logstash JSON format.
In Gemfile add:
gem 'json_logger', github: 'korki/json_logger'
Log:
json_logger = JsonLogger.new('log_path.log')
json_logger.info(
status: 'DONE',
log_type: 'test'
)
json_logger.error(
message: 'NOT GOOD'
)
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request