Library to store custom data in lists by days in Redis. Old data is automatically removed. Useful for debugging and tracking different events in application.
Data is stored in Redis in lists with names: SITE_NAME : lists : list_name : day - Redis list
for example,
mysite:lists:mylist:20130407 - list for day April 04, 2013
It uses gem 'redis' and relies on $redis global variable to access Redis server.
Gemfile:
gem 'redis'
gem 'simple_events_redis'
Setup:
initializer:
# config/initializers/simple_events_redis.rb
require 'events'
$Mylog = SimpleEventsRedis::Events
$Mylog.this_site_name='sitename'
$Mylog.set_config({:EXPIRE_DAYS => 7})
$Mylog.add('debug', {:msg=>'hello. something happened'})