No commit activity in last 3 years
No release in over 3 years
Fluentd adapter for Yell
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 1.8.7
~> 3.12
>= 0
~> 2.8.0

Runtime

~> 2.0
 Project Readme

Fluentd adapter for Yell

If you are not yet familiar with Yell - Your Extensible Logging Library check out the github project under https://github.com/rudionrails/yell or jump directly into the Yell wiki at https://github.com/rudionrails/yell/wiki.

Installation

System wide:

gem install yell-adapters-fluentd```

Or in your Gemfile:

```ruby
gem "yell-adapters-fluentd"

Usage

The Fluentd adapter is based on the GELF adapter at https://github.com/rudionrails/yell-adapters-gelf

logger = Yell.new :fluentd

# or alternatively with the block syntax
logger = Yell.new do |l|
  l.adapter :fluentd
end

logger.info 'Hello World!'

By default, the adapter will send the following information to Fluentd:

level: The current log level
timestamp: The time when the log event occured
host: The current hostname
file: The name of the file where the log event occured
line: The line in the file where the log event occured
_method: The method where the log event occured
_pid: The PID of your current process

Example: Running Fluentd on a different host or port

logger = Yell.new :fluentd, :host => '127.0.0.1', :port => 1234

# or with the block syntax
logger = Yell.new do |l|
  l.adapter :fluentd, :host => '127.0.0.1', :port => 1234
end

logger.info 'Hello World!'

Example: Using a custom tag

By default, the tag "yell" is used. This can be overridden for custom handling.

logger = Yell.new :fluentd, :tag => 'yell.custom'

# or with the block syntax
logger = Yell.new do |l|
  l.adapter :fluentd, :tag => 'yell.custom'
end

logger.info 'Hello World!'

Example: Passing additional keys to the adapter

logger = Yell.new :fluentd

logger.info "Hello World", "_thread_id" => Thread.current.object_id, 
                           "_current_user_id" => current_user.id