Project

kansu

0.0
No commit activity in last 3 years
No release in over 3 years
Gem for log into redis that logstash can read
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

= 1.8.3
 Project Readme

kansu

ELK gem logger using Redis for save logs

Requirements

You need redis gem for save the logs into it.

$ gem install redis

Installation

$ gem 'kansu', :git => 'git://github.com/sergicase/kansu.git'

I'm waiting for publish the gem to https://rubygems.org

Structure

Kansu.new(*Redis(Redis object),*your_list_on_redis(String),debug_mode(Boolean))

You need to use a Redis object or create a new one then a list for save the logs in your redis and if you want debug mode true/false

Kansu.debug("message"(String),"extra"(Array/String))

This log extends from Logger, so you have the same types from logger.

  • Uknown
  • Fatal
  • Error
  • Warn
  • Info
  • Debug

How to (Samples)

Ruby file

$ kansu = Kansu.new(Redis.new,'mylog',false)
$ kansu.debug("Debug this",[:line => 182, :message => "Some error happen", :reason => "no reason"]

Ruby on Rails

Here I prefer an a Initializer when Rails start and then use as a global.

$ $kansu = Kansu.new(Redis.new,'railslog',false)
$ $kansu.debug("Debug Rails",[:say => "Hello Rails", :respond => "Hi, Kansu"]