Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ gem 'puma', '~> 5.6'
gem 'rails', '~> 6.1'
gem 'rack-attack'
gem 'rack-cors'
gem 'rails_semantic_logger', '~> 4.20'
gem 'redcarpet', '~> 3.5'
gem 'redirect_safely', '~> 1.0'
gem 'rexml'
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ GEM
rails-html-sanitizer (1.7.0)
loofah (~> 2.25)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails_semantic_logger (4.20.0)
rack
railties (>= 5.1)
semantic_logger (~> 4.16)
railties (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
Expand Down Expand Up @@ -382,6 +386,8 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 4.0)
websocket (~> 1.0)
semantic_logger (4.18.0)
concurrent-ruby (~> 1.0)
semantic_range (3.1.1)
serrano (1.7)
faraday (~> 2.14, >= 2.14.1)
Expand Down Expand Up @@ -499,6 +505,7 @@ DEPENDENCIES
rack-attack
rack-cors
rails (~> 6.1)
rails_semantic_logger (~> 4.20)
rdoc
redcarpet (~> 3.5)
redirect_safely (~> 1.0)
Expand Down
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class Application < Rails::Application
# Boolean handling of SQLite3
config.active_record.sqlite3&.represent_boolean_as_integer = true

config.semantic_logger.application = 'seqcode-registry'
config.semantic_logger.environment = Rails.env

# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
Expand Down
14 changes: 4 additions & 10 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
config.log_level = :warn

# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
config.log_tags = { request_id: :request_id }

# Use a different cache store in production.
# config.cache_store = :mem_cache_store
Expand Down Expand Up @@ -91,17 +91,11 @@
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify

# 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')
config.rails_semantic_logger.format = :json

if ENV['RAILS_LOG_TO_STDOUT'].present?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to be in use anywhere. We could remove the whole block I think.

logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
config.rails_semantic_logger.add_file_appender = false
config.semantic_logger.add_appender(io: STDOUT, formatter: :json)
end

# Do not dump schema after migrations.
Expand Down
Loading