From ce7292e581ea229b90e10262088c5da4a0df96ff Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Thu, 2 Mar 2017 10:34:01 -0500 Subject: [PATCH] add condensed logging --- Gemfile | 5 +++++ Gemfile.lock | 5 +++++ config/initializers/lograge.rb | 5 +++++ 3 files changed, 15 insertions(+) create mode 100644 config/initializers/lograge.rb diff --git a/Gemfile b/Gemfile index d257db5f..6cf5b618 100644 --- a/Gemfile +++ b/Gemfile @@ -49,6 +49,11 @@ group :development do gem 'spring-watcher-listen', '~> 2.0.0' end +group :production do + # For more condensed logging + gem "lograge" +end + # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/Gemfile.lock b/Gemfile.lock index e1a12cb5..0a422138 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -91,6 +91,10 @@ GEM listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) + lograge (0.4.1) + actionpack (>= 4, < 5.1) + activesupport (>= 4, < 5.1) + railties (>= 4, < 5.1) loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.4) @@ -223,6 +227,7 @@ DEPENDENCIES jquery-rails jquery-ui-rails listen (~> 3.0.5) + lograge omniauth (= 1.3.1) omniauth-google-oauth2 (= 0.4.1) omniauth-twitter (= 1.2.1) diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb new file mode 100644 index 00000000..53b5265a --- /dev/null +++ b/config/initializers/lograge.rb @@ -0,0 +1,5 @@ +Rails.application.configure do + if Rails.env.production? + config.lograge.enabled = ENV['ENABLE_CONDENSED_LOGGING'].present? + end +end