Rails: How to change the logger filename?

一笑奈何 提交于 2021-01-28 11:13:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!