usar lograge + syslog en producción

This commit is contained in:
f 2022-03-19 12:39:12 -03:00
parent 868b3457a8
commit 0adde0c590
3 changed files with 17 additions and 2 deletions

View file

@ -58,3 +58,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'devise'
gem 'devise-i18n'
group :production do
gem 'lograge'
end

View file

@ -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)

View file

@ -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)