slack-logger
Simple Slack logger using ActiveSupport broadcast and slack-ruby-client
Installation
Add this line to your application's Gemfile:
gem 'slack-logger'
And then execute:
$ bundle install
Finally, run the install generator:
$ rails generate slack_logger:install
it will create the following initializer config/initializers/slack_logger.rb
.
This file contains all the information about the existing configuration options.
##Configuration The gem makes use of the rails log and slack-ruby-client to force logs to be sent to both your normal log file and a slack channel.
To configure your rails application simple add the below code to where you setup your rails log
config.after_initialize do
config.logger.extend ActiveSupport::Logger.broadcast(SlackLogger.logger)
end
Contributing
- Fork it ( https://github.com/josephverbeck/slack-logger/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
License
The gem is available as open source under the terms of the MIT License.