No commit activity in last 3 years
No release in over 3 years
A custom notifier for ExceptionNotification which notifies exceptions to Fluentd via fluent-logger
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0
>= 0

Runtime

 Project Readme

ExceptionNotifier::FluentLoggerNotifier

ExceptionNotifier::FluentLoggerNotifier is a custom notifier for ExceptionNotification. 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 is true, the notifier uses Fluent::Logger::TestLogger instead of FluentLogger.

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

  1. Fork it
  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 new Pull Request

License

MIT