diff --git a/app/log/standard_notes_formatter.rb b/app/log/standard_notes_formatter.rb new file mode 100644 index 000000000..780491dc9 --- /dev/null +++ b/app/log/standard_notes_formatter.rb @@ -0,0 +1,10 @@ +class StandardNotesFormatter < ActiveSupport::Logger::SimpleFormatter + def call(severity, timestamp, _progname, message) + { + level: severity, + time: timestamp, + message: message, + ddsource: ['ruby'], + }.to_json + "\n" + end +end diff --git a/config/environments/development.rb b/config/environments/development.rb index e5a65500d..1ba55ca84 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -21,6 +21,9 @@ Rails.application.configure do config.logger = ActiveSupport::Logger.new(STDOUT) end + config.colorize_logging = false + config.logger.formatter = StandardNotesFormatter.new + # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false diff --git a/config/environments/production.rb b/config/environments/production.rb index ea73ceced..152c1d03b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -14,6 +14,9 @@ Rails.application.configure do config.logger = ActiveSupport::Logger.new(STDOUT) end + config.colorize_logging = false + config.logger.formatter = StandardNotesFormatter.new + # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers # and those relying on copy on write to perform better.