Skip to content

Library to track events: counters of events, logging, state monitoring. Data is stored in Redis

Notifications You must be signed in to change notification settings

maxivak/simple_events_redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple tracking of custom events

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.

Overview

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

Installation

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})

Add new item to list

$Mylog.add('debug', {:msg=>'hello. something happened'})

About

Library to track events: counters of events, logging, state monitoring. Data is stored in Redis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages