Changing the Passenger Standalone Log Level

I’m trying to debug an issue with Passenger Standalone 4.0.53 and had a hard time figuring out how to increase the log level. It turns out you have to create a custom Nginx configuration file, then reference it when you start Passenger.

This refers to running Passenger Standalone under Amazon Web Services’ Elastic Beanstalk. My environment is currently set to 64bit Amazon Linux 2014.09 v1.1.0 running Ruby 2.0 (Passenger Standalone).

The basic steps are outlined in the Advanced Configuration section of the Passenger Standalone User’s Guide.

1. Copy the default configuration file (I put it an a Beanstalk support directory):

cp $(passenger-config about resourcesdir)/templates/standalone/config.erb /var/app/support/nginx.conf.erb

2. Edit the nginx.conf.erb file. In the http section, add this line:

passenger_log_level 7;

3. Edit the file that Beanstalk uses to start the Passenger service, /opt/elasticbeanstalk/support/conf/passenger. Under function start(), add this option to the last line:

--nginx-config-template /var/app/support/nginx.conf.erb

4. From a terminal, run sudo service passenger restart.

5. Check the Passenger log in the Beanstalk log folder:

/var/app/support/logs/passenger.log

There should be quite a bit of text from the service starting, and if there is any activity, the file will be growing rapidly.

Once you have the log you need, remove the --nginx-config-template option from the service file and restart the service again.

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.