From 0adde0c5905bc9cede518a949483b252d8706a51 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 19 Mar 2022 12:39:12 -0300 Subject: [PATCH] =?UTF-8?q?usar=20lograge=20+=20syslog=20en=20producci?= =?UTF-8?q?=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 4 ++++ Gemfile.lock | 8 ++++++++ config/environments/production.rb | 7 +++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index d69691a..8106763 100644 --- a/Gemfile +++ b/Gemfile @@ -58,3 +58,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'devise' gem 'devise-i18n' + +group :production do + gem 'lograge' +end diff --git a/Gemfile.lock b/Gemfile.lock index 8a465c9..95a2cc9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,6 +108,11 @@ GEM listen (3.7.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + lograge (0.11.2) + actionpack (>= 4) + activesupport (>= 4) + railties (>= 4) + request_store (~> 1.0) loofah (2.12.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -172,6 +177,8 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (2.2.0) + request_store (1.5.1) + rack (>= 1.4) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) @@ -259,6 +266,7 @@ DEPENDENCIES devise-i18n jbuilder (~> 2.7) listen (~> 3.3) + lograge pg (~> 1.1) puma (~> 5.0) rack-mini-profiler (~> 2.0) diff --git a/config/environments/production.rb b/config/environments/production.rb index 4026992..8f9f202 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -73,12 +73,15 @@ Rails.application.configure do # Tell Active Support which deprecation messages to disallow. config.active_support.disallowed_deprecation_warnings = [] + # Log Rage + config.lograge.enabled = true + # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new # Use a different logger for distributed setups. - # require "syslog/logger" - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + require "syslog/logger" + config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'ectomobile') if ENV["RAILS_LOG_TO_STDOUT"].present? logger = ActiveSupport::Logger.new(STDOUT)