vectordotdev / timber-ruby

🌲 Great Ruby logging made easy.
https://timber.io
Other
154 stars 19 forks source link

Development logs should continue to write to log/development.log #168

Closed binarylogic closed 7 years ago

binarylogic commented 7 years ago

The default behavior of Rails is to write to log/development.log. Timber installs itself as the development logger to ensure the proper logger is used, but it should also write to a file via:

# config/environments/development.rb
rails_config = ::Rails.application.config
file_logger = ActiveSupport::Logger("#{Rails.root}/log/#{Rails.env}.log")
file_logger.formatter = rails_config.log_formatter
file_logger = ActiveSupport::TaggedLogging.new(file_logger)
logger = Timber::Logger.new(STDOUT, file_logger)