Created: 2012-03-26 21:13
Updated: 2018-02-26 04:24
License: mit

Yell Gelf - Graylog2 Adapter for Your Extensible Logging Library

If you are not yet familiar with Yell - Your Extensible Logging Library check out the githup project under or jump directly into the Yell wiki at

Just in case you wonder: GELF means Graylog Extended Log Format. Read all it at

Build Status

The Graylog adapter for Yell works and is tested with ruby 1.8.7, 1.9.x, jruby 1.8 and 1.9 mode, rubinius 1.8 and 1.9 as well as ree.


System wide:

gem install yell-adapters-gelf

Or in your Gemfile:

gem "yell-adapters-gelf"


After you set-up Graylog2 accordingly, you may use the Gelf adapter just like any other.

logger = :gelf

# or alternatively with the block syntax
logger = do |l|
  l.adapter :gelf
end 'Hello World!'

Now check your Graylog2 web server for the received message. By default, the gelf adapter will send the following information to Graylog2:

facility: The GELF facility (default: 'yell')
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 with a different GELF facility

logger = :gelf, :facility => 'my own facility'

# or with the block syntax
logger = do |l|
  l.adapter :gelf, :facility => 'my own facility'

Example: Running Graylog2 on a different host or port

logger = :gelf, :host => '', :port => 1234

# or with the block syntax
logger = do |l|
  l.adapter :gelf, :host => '', :port => 1234
end 'Hello World!'

Example: Passing additional keys to the adapter

logger = :gelf "Hello World", "_thread_id" => Thread.current.object_id, 
                           "_current_user_id" =>

Copyright © 2012 Rudolf Schmidt, released under the MIT license

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more