Slack bug notification
Sometimes we may need to check the error log for our applications. It is a bit troublesome to check the logs. Thanks to slack notifier, we can now receive our error logs real time.
Gems
- exception_notification
- slack-notifier
Project Setup
- Go to https://slack.com/apps/A0F7XDUAZ-incoming-webhooks
- Choose your team and press configure.
- In configurations press add configuration.
- Choose channel, press “Add Incoming WebHooks integration”.
- From the rails app configure the config/environments/production.rb.
Rails.application.config.middleware.use ExceptionNotification::Rack,
:slack => {
:webhook_url => "#{ENV["SLACK_WEBHOOK_URL"]}",
:channel => "#{ENV["SLACK_BUG_CHANNEL"]}",
:username => "notifier",
:additional_parameters => {
:mrkdwn => true
}
}
- Once everything is done, you will receive the error reporting in real time.