From 180481aea527acbde2055a468664a035036ccc91 Mon Sep 17 00:00:00 2001 From: Gareth Rushgrove Date: Thu, 5 Jan 2012 09:42:08 +0000 Subject: [PATCH] add gelf logging --- Gemfile | 3 ++- Gemfile.lock | 6 ++++++ config/environments/production.rb | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 7bc33b6..8f54540 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,8 @@ gem 'stringex' gem 'loofah' gem 'nokogiri' gem 'whenever' - +gem 'gelf' +gem 'graylog2_exceptions' gem 'plek', '~> 0' gem 'aws-ses', :require => 'aws/ses' diff --git a/Gemfile.lock b/Gemfile.lock index 5cff68f..6957541 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,6 +56,10 @@ GEM exception_notification (2.5.2) actionmailer (>= 3.0.4) ffi (1.0.11) + gelf (1.1.3) + json + graylog2_exceptions (1.3.0) + gelf (= 1.1.3) guard (0.9.4) ffi (>= 0.5.0) thor (~> 0.14.6) @@ -159,6 +163,8 @@ DEPENDENCIES aws-ses ci_reporter exception_notification + gelf + graylog2_exceptions guard guard-minitest jquery-rails diff --git a/config/environments/production.rb b/config/environments/production.rb index c678b3f..31497ab 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,6 +1,8 @@ Fco::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.middleware.use "Graylog2Exceptions", { :hostname => 'graylog.cluster', :port => '12201', :facility => 'fco'} + # Code is not reloaded between requests config.cache_classes = true @@ -35,6 +37,7 @@ # Use a different logger for distributed setups # config.logger = SyslogLogger.new + config.logger = GELF::Logger.new("graylog.cluster", "12201", max_size = 'WAN', { :facility => "fco" }) # Use a different cache store in production # config.cache_store = :mem_cache_store