mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-06 02:51:34 +00:00
Restore file logging for custom format logger
The new custom logger was directed to stdout instead of a file.
This commit is contained in:
@@ -34,13 +34,14 @@ Openfoodnetwork::Application.configure do
|
||||
config.action_mailer.default_url_options = { protocol: 'https' }
|
||||
|
||||
# See everything in the log (default is :info)
|
||||
config.log_level = :info
|
||||
# config.log_level = :debug
|
||||
|
||||
# Configure logging
|
||||
Rails.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
|
||||
Rails.logger.formatter = Logger::Formatter.new
|
||||
Rails.logger.datetime_format = "%Y-%m-%d %H:%M:%S"
|
||||
config.logger = Rails.logger
|
||||
# Configure logging for Rails 3.2:
|
||||
config.logger = ActiveSupport::TaggedLogging.new(Logger.new(Rails.root.join("log", "#{Rails.env}.log")))
|
||||
config.logger.formatter = Logger::Formatter.new
|
||||
config.logger.datetime_format = "%Y-%m-%d %H:%M:%S"
|
||||
# Once we get to Rails 4.0, we can replace the above with:
|
||||
#config.log_formatter = Logger::Formatter.new.tap { |f| f.datetime_format = "%Y-%m-%d %H:%M:%S" }
|
||||
|
||||
# Use a different cache store in production
|
||||
memcached_value_max_megabytes = ENV.fetch("MEMCACHED_VALUE_MAX_MEGABYTES", 1).to_i
|
||||
|
||||
@@ -36,11 +36,12 @@ Openfoodnetwork::Application.configure do
|
||||
# See everything in the log (default is :info)
|
||||
# config.log_level = :debug
|
||||
|
||||
# Configure logging
|
||||
Rails.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
|
||||
Rails.logger.formatter = Logger::Formatter.new
|
||||
Rails.logger.datetime_format = "%Y-%m-%d %H:%M:%S"
|
||||
config.logger = Rails.logger
|
||||
# Configure logging for Rails 3.2:
|
||||
config.logger = ActiveSupport::TaggedLogging.new(Logger.new(Rails.root.join("log", "#{Rails.env}.log")))
|
||||
config.logger.formatter = Logger::Formatter.new
|
||||
config.logger.datetime_format = "%Y-%m-%d %H:%M:%S"
|
||||
# Once we get to Rails 4.0, we can replace the above with:
|
||||
#config.log_formatter = Logger::Formatter.new.tap { |f| f.datetime_format = "%Y-%m-%d %H:%M:%S" }
|
||||
|
||||
# Use a different cache store in production
|
||||
memcached_value_max_megabytes = ENV.fetch("MEMCACHED_VALUE_MAX_MEGABYTES", 1).to_i
|
||||
|
||||
Reference in New Issue
Block a user