damir / slack-logger

A Simple Slack logger for Rails API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slack-logger

Build Status Code Climate Test Coverage Gem Version

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

  1. Fork it ( https://github.com/josephverbeck/slack-logger/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

The gem is available as open source under the terms of the MIT License.

About

A Simple Slack logger for Rails API

License:MIT License


Languages

Language:Ruby 83.0%Language:HTML 12.4%Language:JavaScript 2.7%Language:CSS 1.8%