5

Rails 3 seems to have had a property in config for changing the output location of Rails.logger, config.log_path. That's been deprecated. Looking at a Rails 6 application, is this the way to do that now? Or did this config property get moved to something new?

  logger           = ActiveSupport::Logger.new('log/blahblah.log')
  logger.formatter = config.log_formatter
  config.logger    = ActiveSupport::TaggedLogging.new(logger)
cdmo
  • 1,239
  • 2
  • 14
  • 31

1 Answers1

4

This will do the trick:

config.paths['log'] = 'log/new_log_file.log'

You can read more about paths here: https://api.rubyonrails.org/classes/Rails/Application/Configuration.html#method-i-paths

nuaky
  • 2,036
  • 1
  • 14
  • 20
  • 1
    Awesome. I saw the deprecation notice and tried `config.paths.log` instead but see now that `paths` is a `Hash`. Thanks – cdmo Aug 17 '20 at 13:37