Actions
Improvement #810
closedChange logging to file by default
Start date:
Due date:
% Done:
100%
Estimated time:
Affected component:
Compatible Redmine Version:
Pull Request Link:
Description
Currently, xmera Omnia loggs both to STDOUT and file:
logfile = Rails.root.join("log", "#{Rails.env}.log")
console_logger = ActiveSupport::Logger.new(STDOUT)
file_logger = ActiveSupport::Logger.new(logfile)
config.logger = console_logger.extend(ActiveSupport::Logger.broadcast(file_logger))
config.datetime_format = "%Y-%m-%d %H:%M:%S"
config.log_level = ENV.fetch("LOG_LEVEL", "DEBUG")
config.log_tags = [:request_id]
This will give to much information when running some rake tasks for example.
Updated by liaham almost 3 years ago
Its now:
require "active_support/core_ext/numeric/bytes"
config.log_file = Rails.root.join("log", "#{Rails.env}.log")
# Rotate either over the number of old log files to keep or
# the frequency: daily, weekly, monthly
config.log_file_rotation = 1
config.max_file_size = 50.megabytes
console_logger = ActiveSupport::Logger.new(STDOUT)
file_logger = ActiveSupport::Logger.new(config.log_file,
config.log_file_rotation,
config.max_file_size)
# If required, change the logger to console_logger instead.
config.logger = file_logger
Updated by liaham almost 3 years ago
- Status changed from New to Closed
- Assignee set to liaham
- % Done changed from 0 to 100
Actions