ExceptionNotifier::FluentLoggerNotifier
ExceptionNotifier::FluentLoggerNotifier
is a custom notifier for ExceptionNotifier.
It sends exception notifications to Fluentd data collector via fluent-logger.
Installation
Add this line to your application's Gemfile:
gem 'exception_notification_fluent_logger_notifier'
And then execute:
$ bundle
Or install it yourself as:
$ gem install exception_notification_fluent_logger_notifier
Usage
As other exception notifiers, add settings at the environments.
- Key
tag_prefix
is for the fluentd tag. - Key
template
is for setting log format and must be Hash. - Key
logger_settings
is for settings of the logger instance. - If key
test_logger
istrue
, the notifier useFluent::Logger::TestLogger
instead ofFluentLogger
.
See also exception_notifier's doc.
Example
Whatever::Application.config.middleware.use ExceptionNotification::Rack,
:fluent_logger => {
:tag_prefix => "exceptions",
:logger_settings => {
:host => "localhost",
:port => 8888,
}
:template => {
exception_class: ->(exception, options) { exception.class_name },
exception_message: -> (exception, options) { exception.messaage },
}
}
Contributing
- Fork it
- 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 new Pull Request