Ruby wrapper for multiple reporting services.
Supported services:
- Rails logger
- Audited
- PaperTrail
- Sentry
- Honeybadger
- scoutapm
Sponsored by Kisko Labs.
Using Bundler:
bundle add action_reporter
Using RubyGems:
gem install action_reporter
gem 'action_reporter'
Put this in your config/initializers/action_reporter.rb
file:
ActionReporter.enabled_reporters = [
ActionReporter::RailsReporter.new,
# ActionReporter::AuditedReporter.new,
# ActionReporter::PaperTrailReporter.new,
# ActionReporter::SentryReporter.new,
# ActionReporter::HoneybadgerReporter.new,
# ActionReporter::ScoutApmReporter.new
]
Then you can use it in your code:
ActionReporter.current_user = current_user
ActionReporter.current_request_uuid = request.env['action_dispatch.request_id']
ActionReporter.current_remote_addr = request.env['action_dispatch.remote_ip']
ActionReporter.context(entry_id: entry.id)
ActionReporter.notify('Something went wrong', context: { record: record })
Apply patch on initializer level or before running the main code:
module ActionReporter
class RailsReporter < Base
def notify(error, context: {})
super
binding.pry
end
end
end
Bug reports and pull requests are welcome on GitHub at https://github.com/amkisko/action_reporter.rb
Contribution policy:
- It might take up to 2 calendar weeks to review and merge critical fixes
- It might take up to 6 calendar months to review and merge pull request
- It might take up to 1 calendar year to review an issue
- New integrations and third-party features are not nessessarily added to the gem
- Pull request should have test coverage for affected parts
- Pull request should have changelog entry
rm action_reporter-*.gem
gem build action_reporter.gemspec
gem push action_reporter-*.gem
The gem is available as open source under the terms of the MIT License.