Class: Logging::Appenders::Redis

Inherits:
Logging::Appender
  • Object
show all
Includes:
Buffering
Defined in:
lib/logging/appenders/redis.rb

Overview

Provides an appender that can append log messages to a Redis list

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, opts = {}) ⇒ Redis

Returns a new instance of Redis.



18
19
20
21
22
# File 'lib/logging/appenders/redis.rb', line 18

def initialize(name, opts = {})
  super(name, opts)
  configure_buffering(opts)
  @redis = ::Redis.new
end

Instance Attribute Details

#redisObject (readonly)

Returns the value of attribute redis.



16
17
18
# File 'lib/logging/appenders/redis.rb', line 16

def redis
  @redis
end

Instance Method Details

#close(*_args) ⇒ Object

Close the Redis appender.



26
27
28
# File 'lib/logging/appenders/redis.rb', line 26

def close(*_args)
  super(false)
end