Skip to content

A custom rails logger that outputs JSON instead of raw text

License

Notifications You must be signed in to change notification settings

andrew-pickin-epi/json-rails-logger

 
 

Repository files navigation

json-rails-logger

A custom rails logger that outputs JSON instead of raw text. As an extra the logger also saves the request_id for any log message, in the returned JSON object. The formatter has a couple of changes that are down to preference, but these don't affect the functionality in any way. This gem can be used with any Rails app using the installation steps below.

Installation

In your Rails app, add this to your gemfile:
gem 'json_rails_logger', git: '[email protected]:epimorphics/json-rails-logger.git'

And this to your environment config:
config.logger = JsonRailsLogger::Logger.new(STDOUT)

Running the tests

Tests are located in the ./test/ folder.

After cloning the repo, first execute:
bundle install

To run the tests, use:
rake test

About

A custom rails logger that outputs JSON instead of raw text

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%