问题
I'd like to change the logger filename. The default, say, on production, is production.log
.
I'd like it be customized, for example, to production.mymachine.log
.
How can I do this? I can't find any obvious way.
回答1:
You can change this application wide in config/application.rb
or for each environment in their dedicated files in config/environments
# e.g. in config/environments/development.rb
config.logger = Logger.new(Rails.root.join('log', 'development.my_machine.log'))
来源:https://stackoverflow.com/questions/63737408/rails-how-to-change-the-logger-filename