class ExceptionNotifier::FluentLoggerNotifier
Constants
- VERSION
Attributes
logger[RW]
template[RW]
Public Class Methods
new(options)
click to toggle source
# File lib/exception_notifier/fluent_logger_notifier.rb, line 8 def initialize(options) @template = options.delete(:template) raise ConfigurationError, "`template` key must be set" unless @template logger_settings = options.delete(:logger_settings) || {} if options.delete(:test_logger) @logger = Fluent::Logger::TestLogger.new else tag_prefix = options.delete(:tag_prefix) @logger = Fluent::Logger::FluentLogger.new(tag_prefix, logger_settings) end end
Public Instance Methods
call(exception, options={})
click to toggle source
# File lib/exception_notifier/fluent_logger_notifier.rb, line 21 def call(exception, options={}) arg = Argument.build(template, exception, options) logger.post(nil, arg) end