Project

flnt

0.01
No commit activity in last 3 years
No release in over 3 years
Gentle post-to-fluentd log solution
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0
>= 3.1

Runtime

 Project Readme

Flnt

Gentle post-to-fluentd log solution.

Gem Version

Powered by wercker

wercker status

Installation

Usual Gemfile way:

gem 'flnt'
$ bundle install

Usage

Just post log to fluent

  • Setting up fluentd on your localhost:24224
  • Call the methods below:
Flnt.app.payment.info "Payment done"
  • Then, your fluentd receives json {message: "Payment done"} with tag app.payment.info

Flnt compiles method chaining into a tag, and when the method is called with an argument, it emits the information to fluentd.

NOTE: You cannot use methods such as foo? or foo! for tag suffix. only /[a-zA-Z0-9_]/ are OK.

Force custome tag

Flnt.tag!("app.event.login.info").emit! "Logged in: #{current_user.name}"

Flunt.tag! initializes logger with a tag, and Flnt::Logger#emit! will just send a data to fluentd without appending a tag suffix.

Configuration of fluentd

Flnt::Configuration.configure do |c|
  c.prefix = "foobar"
  c.host = 'fluentd.example.jp'
  c.port = 12345
end

License

see LICENSE.txt.

Contributing

The usual github way.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request