简体   繁体   中英

Rails | How to see live server log in production?

How to see the live server log in production like it is shown in development?

服务器登录开发

My app is on digitalOcean, if that helps. I am using unicorn as my production server.

When I do tail -f log/production.log , I can just see some migration info like this, but not the live requests info along with the SQL queries being run.

在此处输入图片说明

Also in my production.rb, I changed config.log_level to :debug

Try adding these lines of code into config/environments/production.rb :

Rails.logger = Logger.new(STDOUT)

config.logger = ActiveSupport::Logger.new("log/#{Rails.env}.log")

Reference:

This article for more info on logger

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM