gem version

Log file

Relevant selection for this article:

Nginx

Passenger logs all its messages to a log file. Inside this log file you will find informational messages, errors, warnings and debugging messages generated by Passenger, as well as application output. Whenever Passenger wants to tell you something, it is done through this log file, so you should check this file whenever you suspect that something is wrong.

This guide teaches you where to find the log file, how to customize its location and verbosity, and teaches you other miscellaneous things that you should know.

Table of contents

  1. Loading...

Location of the log file

By default, the Passenger log file is the global (not the per-vhost) Apache error log file. This is typically located in /var/log/apache2/error_log.

You can find out the exact location of the error log by running passenger-config --detect-apache2.

Or, if you configured the PassengerLogFile directive, then the log file is in the referenced file.

Make sure you select the right integration in the config reference article mentioned above.

Application output logging

Stdout and stderr

Everything that the application writes to the stdout and stderr channels is logged to the log file at log level 3 (the default log level for Passenger).

Application log

The application or web framework may have its own log file that is independent from the Passenger log file. You should also check that file to see whether your application or web framework has logged any important messages.

For example, Ruby on Rails logs to log/development.log and log/production.log. When an error occurs during request handling, it is typically logged here. Note that this file does not contain errors that Rails encounters during startup – those kinds of errors are typically written to stderr, which means they end up in the Passenger log instead.

Note that Passenger runs applications in the "production" environment by default (that is, Passenger sets RAILS_ENV, RACK_ENV, NODE_ENV and related environment variables "production"). So if you're using Rails, please be sure to check production.log instead of development.log.

Customizing the log file

You can instruct Passenger to log to a specific log using the PassengerLogFile option.

By default, Passenger only prints important informational messages, warnings and errors. You can configure Passenger to log less important messages too, such as debugging messages, through PassengerLogLevel.

Make sure you select the right integration in the config reference article mentioned above.

Troubleshooting logging problems

Messages may get lost by log rotation problems

Is your Passenger log file the Apache error log? And do you not find anything useful inside it, while at the same time it looks like Passenger stopped logging to the file quite some time ago? Then you probably have a log rotation problem, causing logs to get lost. Please configure Passenger log rotation.

Application stdout/stderr problems

Are you expecting to find application output in the log file, but don't actually see it? Then the cause may be that the application has modified stdout and stderr. Learn more about this.

Try raising the log level

Sometimes there's actually nothing wrong with the log file. Try raising the log level so that you see more messages.

light mode dark mode
Passenger 6 Passenger 6