Where to find php logs, php-fpm logs? This page will explain all.
Location
All PHP logs can be found within `mdoq/var/log/php-fpm` there are multiple files in this directory.
The keys ones are:
- error.log - This is the error log from PHP-FPM.
- mdoq-access.log - This is a custom access log, only found in MDOQ environments. (see MDOQ Access Log)
You may also see these files suffixed with dates and/or compressed, see Rotation.
MDOQ Access Log
It logs the start and end of every PHP request. The reason this is useful is that the default PHP access log (and also Nginx logs) will not log anything until the transaction completes.
If the transaction is currently running, or it fails, or PHP-FPM is restarted, there will be no record of it. This isn't very useful especially when you are trying to find work out why a site is busy/slow.
With all MDOQ environments there is a bash script provided that will allow you to see the currently running web requests: `mdoq-running-php-requests`.
This will evalutate the log file and display the currently running requests.
If you would like to watch this over a time period, you can run something like:
watch -n 1 mdoq-running-php-requests;
Rotation
All logs are rotated nightly.
Previously rotated logs are compressed after one day.
Previously rotated and compressed logs are removed after 14 days.