https://github.com/sshaw/logging-honeybadger
Honeybadger appender for the Logging gem
https://github.com/sshaw/logging-honeybadger
honeybadger logging logging-library ruby
Last synced: about 1 year ago
JSON representation
Honeybadger appender for the Logging gem
- Host: GitHub
- URL: https://github.com/sshaw/logging-honeybadger
- Owner: sshaw
- Created: 2023-07-22T18:28:05.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-09T03:50:54.000Z (almost 3 years ago)
- Last Synced: 2025-03-15T23:18:19.488Z (over 1 year ago)
- Topics: honeybadger, logging, logging-library, ruby
- Language: Ruby
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Logging Honeybadger
[](https://github.com/sshaw/logging-honeybadger/actions/workflows/ci.yml)
Honeybadger appender for [the Logging gem](https://github.com/TwP/logging)
## Overview
Install the gem: `gem install logging-honeybadger`.
If you're using Bundler add the following to your `Gemfile`: `gem "logging-honeybadger", :require => false`
Then add the Honeybadger appender:
```rb
require "logging"
log = Logging.logger[self]
log.add_appenders(
Logging.appenders.honeybadger(
:api_key => "123XYZ",
:exceptions => { :ignore => %w[SomeThang AnotherThang] }
)
)
# Or
Honeybadger.configure do |cfg|
# ...
end
log.add_appenders(Logging.appenders.honeybadger)
log.info "Not sent to honeybadger"
log.error "Honeybadger here I come!"
log.error SomeError.new("See you @ app.honeybadger.io!")
```
Note that Logging will load the appender. You do not need to explicitly require it.
## Description
Only events with the `:error` log level are sent to Honeybadger.
By default the appender will be named `"honeybadger"`. This can be changed by passing a name
to the `honeybadger` method:
Logging.appenders.honeybadger("another_name", options)
Honeybadger configuration can be done via `Honeybadger.configure` or via `Logging.appenders.honeybadger`.
The later accepts (most) Honeybadger options via the `options` `Hash`.
## See Also
[`Logging::Appenders::Airbrake`](https://github.com/sshaw/logging-appenders-airbrake) - Airbrake appender for the Logging gem
## Author
Skye Shaw [sshaw AT gmail.com]
## License
Released under the MIT License: www.opensource.org/licenses/MIT