Rails not writing to production logs

Posted June 20, 2014 34.8k views
I followed the tutorial ( to get my rails app up and running with dokku. When I do: dokku logs APP_NAME, all that I see are three lines corresponding to the server starting, so my logs aren't being written to properly. How can I debug this? Common reasons my app isn't writing production logs? Thanks
1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
5 answers
Do you have any logging related values set in config/environments/production.rb ? The default should be:
config.log_level = :info
RAILS_DEFAULT_LOGGER ='log/production.log')
Make sure you haven't used SyslogLogger as that will log to the OS syslog, not a separate Rails app log, and Dokku won't find it. If you need to dig around in the container itself to debug and make sure the log is actually being created, you can run:
 dokku run app_name '/bin/bash'
  • I have the two lines in production.rb you specify. When I do: dokku run app_name '/bin/bash' the production.log is indeed empty. Only line is: # Logfile created on 2014-06-20 17:34:50 +0000 by logger.rb/41954 Permissions for the file production.log are: -rw-r--r--r 1 root root 66 Jun 20 17:34 production.log Those look good as well. Any other thoughts on what may be wrong?
  • Appears there may be bigger problems: dokku run app_name rails c results in: stat /exec: no such file or directory These two issues are related?
Okay I fixed the rails c problem, but the logs debacle still remains unfortunately. Do you know of any other alternatives for generating logs I can use in the meantime?

Has anyone found a solution to this problem? I’m having the exact same issue.

Try doing docker ps to get a list of your containers. Find your container under the container ID column. After that do docker logs <container-id>.

You have to redirect logs to Stdout, so edit config/environments/production.rb properly:

logger           =
logger.formatter = config.log_formatter
config.logger    =

Hint: maybe you need the Lograge gem too.