Skip to content

Commit

Permalink
Disable Semantic Logger in development
Browse files Browse the repository at this point in the history
For consistent log output in development, follow the convention of
several other services (RSM, AYTQ, FALTRN) and use standard Rails log
output rather than Semantic Logger.
  • Loading branch information
malcolmbaig committed May 30, 2024
1 parent cc0a178 commit 507c12a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ group :development, :test, :review do
gem "factory_bot_rails"
end

group :development, :production do
group :production do
gem "rails_semantic_logger"
end
4 changes: 0 additions & 4 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,4 @@

# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
#
config.log_level = :debug # Or :info
config.log_format = :color # Console colorised non-json output
config.semantic_logger.backtrace_level = :debug # Show file and line number (expensive: not for production)
end
6 changes: 4 additions & 2 deletions config/initializers/semantic_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
config.log_tags = [:request_id] # Prepend all log lines with the following tags
end

SemanticLogger.add_appender(io: $stdout, level: Rails.application.config.log_level,
formatter: Rails.application.config.log_format)
SemanticLogger.add_appender(
io: $stdout, level: Rails.application.config.log_level,
formatter: Rails.application.config.log_format
)
Rails.application.config.logger.info('Application logging to STDOUT')

0 comments on commit 507c12a

Please sign in to comment.