Cover of the book Symfony 5: The Fast Track

Symfony 5: The Fast Track is the best book to learn modern Symfony development, from zero to production. +300 pages in full color showing how to combine Symfony with Docker, APIs, queues & async tasks, Webpack, Single-Page Applications, etc.

Buy printed version



The log messages generated by the different tasks running on an application container can be accessed via the log command:

# display all messages from all log files
$ symfony log all

# display the messages of a specific log file
# (the argument is the name of the log file without the '.log' extension)
$ symfony log error

# display the messages of several log files
$ symfony log app error

As explained in the next sections, the exact log files available depend on the application container in use. Log rotation is not enabled by default, but each log file is limited to 10 MB in size automatically because log files are counted towards your disk quota (if a log file reaches that size limit, older messages are discarded).


In addition to the log command, log files are also accessible via SSH in the /var/log directory of the application container.


Although the /var/log directory is writable, it should not be written to directly. Only write to it via standard logging mechanisms, such as your application’s logging facility.

Deployment Logs


The deploy log contains the output of the most recent runs of the deploy hook for the container. If there is no deploy hook then this file will be absent.


The post_deploy log contains the output of the most recent runs of the post_deploy hook for the container. If there is no post_deploy hook then this file will be absent.

Application Logs


Any log messages generated by the application will be sent to this file. That includes language errors such as PHP Errors, Warnings, and Notices, as well as uncaught exceptions. It also contains your application logs if you log on stderr.


When running a Symfony application, the log command also gives access to the log files stored under /app/app/logs/*.log, /app/var/logs/*.log, and /app/var/log/*.log:

# tail on /app/app/logs/prod.log
$ symfony log prod


The cron log contains the output of all recent executions of cron jobs. If there is no cron hook specified in the container configuration or if no cron has been executed yet, then this file will be absent.


On a PHP container, the php.access contains a record of all requests to the PHP service.

Nginx Logs


This is the raw access log for the nginx instance running on the application container. That is, it does not include any requests that return a redirect or cache hit from the router.


Nginx-level errors that occur once nginx has fully started will be recorded here. This will include HTTP 500 errors for missing directories, file types that are excluded based on the file, etc.


Nginx startup log messages will be recorded in this file. It rarely happens except when debugging possible nginx configuration errors.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.