Ask A Question

Notifications

You’re not receiving notifications from this thread.

production.log is nowhere to be found on Digital Ocean

Yi Mei Wang asked in Servers

Hey everyone, so I deployed my app onto Digital Ocean according to the Gorails guide and I managed to get it working. My is able to connect to DO's managed database, and serve content normally.

I moved on to set up log rotation, but it seems like there is no "production.log" anywhere in my app? I can see all of Rail's incoming request logged on nginx's error.log but nothing is actually written the production.log. I am very confused as to why this happens?

Since these are requests log, it doesn't seem right that it would be in the error log. But it also seems like Nginx handles it's own log rotation because I see that everytime I run the command /usr/sbin/logrotate -f /etc/logrotate.conf, it automatically deletes the old logs.

I'd appreciate if anyone can explain why or how to fix this? It also feels like I could just leave it as it is, since ultimately requests are being logged, though I'm not sure if this is a good practice.

Reply

Hey Yi Mei Wang, I had a similar problem with logs not showing in Production and I simply added the following to config/environment/production.rb:
'config.log_level = :info
RAILS_DEFAULT_LOGGER = Logger.new('log/production.log')'

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.