Module: RedisStreamLogger
- Defined in:
- lib/redis_stream_logger.rb,
lib/redis_stream_logger/config.rb,
lib/redis_stream_logger/railtie.rb,
lib/redis_stream_logger/version.rb,
lib/redis_stream_logger/log_device.rb
Defined Under Namespace
Classes: Config, Error, LogDevice
Constant Summary collapse
- VERSION =
"0.2.0"
Class Method Summary collapse
-
.setup(app) ⇒ Object
I based this heavily on the LogstashLogger implementation but we’ll only accept our own config class here.
Class Method Details
.setup(app) ⇒ Object
I based this heavily on the LogstashLogger implementation but we’ll only accept our own config class here
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/redis_stream_logger/railtie.rb', line 6 def self.setup(app) return unless app.config.redis_stream_logger.present? conf = app.config.redis_stream_logger raise ArgumentError, 'unexpected config class' unless conf.is_a?(Config) logdev = RedisStreamLogger::LogDevice.new do |_c| conf end logger = Logger.new(logdev) logger.level = app.config.log_level app.config.logger = logger end |