Skip to content

Commit

Permalink
misc(configuration): configure log level (getlago#1614)
Browse files Browse the repository at this point in the history
* misc(configuration): configure log level

* remove lograge sql

* fix present

* wrong if order...
  • Loading branch information
jdenquin authored Jan 18, 2024
1 parent 9defaa6 commit 88eb152
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ gem 'analytics-ruby', '~> 2.4.0', require: 'segment/analytics'

# Logging
gem 'lograge'
gem 'lograge-sql'
gem 'logstash-event'

# Multipart support
Expand Down
4 changes: 0 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,6 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
lograge-sql (2.1.0)
activerecord (>= 5, < 7.1)
lograge (~> 0.11)
logstash-event (1.2.02)
loofah (2.21.4)
crass (~> 1.0.2)
Expand Down Expand Up @@ -569,7 +566,6 @@ DEPENDENCIES
kaminari-activerecord
karafka
lograge
lograge-sql
logstash-event
money-rails
multipart-post
Expand Down
7 changes: 6 additions & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
:local
end

config.log_level = :info
config.log_level = if ENV['LAGO_LOG_LEVEL'].present? && ENV['LAGO_LOG_LEVEL'] != ''
ENV['LAGO_LOG_LEVEL'].downcase.to_sym
else
:info
end

config.log_tags = [:request_id]
config.action_mailer.perform_caching = false
config.i18n.fallbacks = true
Expand Down
7 changes: 6 additions & 1 deletion config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
:local
end

config.log_level = :info
config.log_level = if ENV['LAGO_LOG_LEVEL'].present? && ENV['LAGO_LOG_LEVEL'] != ''
ENV['LAGO_LOG_LEVEL'].downcase.to_sym
else
:info
end

config.log_tags = [:request_id]
config.action_mailer.perform_caching = false
config.i18n.fallbacks = true
Expand Down
2 changes: 0 additions & 2 deletions config/initializers/lograge.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'lograge/sql/extension'

Rails.application.configure do
config.lograge.enabled = true
config.lograge.formatter = Lograge::Formatters::Json.new
Expand Down

0 comments on commit 88eb152

Please sign in to comment.