Allow logging of reds operations
MODIFY
lib/beetle/configuration.rb
lib/beetle/configuration.rb
@@ -16,6 +16,8 @@ module Beetle
# default logger (defaults to <tt>Logger.new(log_file)</tt>)
attr_accessor :logger
# defaults to <tt>STDOUT</tt>
+ attr_accessor :redis_logger
+ # set this to a logger instance if you want redis operations to be logged. defaults to <tt>nil</tt>.
attr_accessor :log_file
# number of seconds after which keys are removed from the message deduplication store (defaults to <tt>1.hour</tt>)
attr_accessor :gc_threshold

MODIFY
lib/beetle/deduplication_store.rb
lib/beetle/deduplication_store.rb
@@ -134,7 +134,7 @@ module Beetle
# set current redis master instance (as specified in the Beetle::Configuration)
def redis_master_from_server_string
- @current_master ||= Redis.from_server_string(@config.redis_server, :db => @config.redis_db)
+ @current_master ||= Redis.from_server_string(@config.redis_server, :db => @config.redis_db, :logger => @config.redis_logger)
end
# set current redis master from master file
@@ -152,7 +152,7 @@ module Beetle
def set_current_redis_master_from_master_file
@last_time_master_file_changed = File.mtime(@config.redis_server)
server_string = extract_redis_master(read_master_file)
- @current_master = !server_string.blank? ? Redis.from_server_string(server_string, :db => @config.redis_db) : nil
+ @current_master = !server_string.blank? ? Redis.from_server_string(server_string, :db => @config.redis_db, :logger => @config.redis_logger) : nil
end
# extract redis master from file content and return the server for our system

Allow logging of reds operations