Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Installation

You can install graylog2_exceptions as a gem from rubygems.org:

$ gem install graylog2_exceptions
Successfully installed gelf-1.0.0
Successfully installed graylog2_exceptions-1.0.0
2 gems installed

Configure your Rack application

The Graylog2Exceptions middleware takes a few arguments:

  • hostname: The host your graylog2-server is running on
  • port: The GELF listen port of your graylog2-server instance
  • level: (optional) The standard log level. (0 = debug - 5 = alert)
  • facility: (optional) A facility string (Standard: graylog2_exceptions)
  • local_app_name: (optional) Override the hostname of the machine your Rack application is running on with this parameter
  • max_chunk_size: (optional) The maximum size of GELF chunks. Just don't use if unsure what it does.

Every parameter that starts with an underscore is treated and submitted as additional parameter. You can add as many as you like.

Rails 3

Add graylog2_exceptions to your Gemfile and run bundle install.

Now add the following line to your config/application.rb

config.middleware.use "Graylog2Exceptions", { :hostname => '127.0.0.1', :port => '12201', :level => 0, :_custom_param_1 => "foo", :_custom_param_2 => "bar" }

Rails 2

Add the following line to your config/environment.rb and require 'graylog2_exceptions' before:

config.middleware.use "Graylog2Exceptions", { :hostname => '127.0.0.1', :port => '12201', :level => 0, :_custom_param_1 => "foo", :_custom_param_2 => "bar" }

Sinatra

You can use the Notifier in Sinatra apps too.

Add the gem to your Gemfile and bundle install

Add this to you app class:

   use  Graylog2Exceptions, { :local_app_name => "MyApp", :hostname => '127.0.0.1', :port => 12201, :max_size=>'wan', :level => 0 }

Set raise error to true:

   set :raise_errors, true

Developer resources

Hudson, Sonar: https://github.com/Graylog2/graylog2-docs/wiki/Hudson,-Sonar

Something went wrong with that request. Please try again.