1

I have a Rails 5.0 app running in Passenger with Nginx as the web server.

I can't seem to get the app to output its logs into a file in log/ under the Rails root directory.

RAILS_LOG_TO_STDOUT is NOT set in my environment.

I can confirm that the log file I specify in config/logs/production.rb gets created, but subsequent logger output is not sent to it. My log_level is debug. Instead, the app sends all log output to STDOUT which Passenger dutifully appends to its own log file.

Why?

sameers
  • 4,855
  • 3
  • 35
  • 44

1 Answers1

0

I figured it out when someone discussing logging for Rails apps mentioned Heroku's rails_12factor gem. I had moved this app from a previous Heroku deployment and didn't realize that gem would capture log output even when not deployed within a Heroku dyno.

The log file is used when the gem is removed.

sameers
  • 4,855
  • 3
  • 35
  • 44