Customized error log
(Recommended tutorial: apache from entry to proficiency)
If we want to find the custom error log location, open /etc/apache2/apache2.conf with a text editor, and then look for the line starting with ErrorLog, which specifies the location of the custom Apache error log file.
For example, the following line can be found in the unmodified Apache configuration file:
ErrorLog ${APACHE_LOG_DIR}/error.log
This location is configured using the APACHELOGDIR environment variable, which has been used in /etc/apache2/envvars definition.
export APACHE_LOG_DIR=/var/log/apache2$SUFFIX
In actual situations, ErrorLog may point to any path in your Linux system.
Use virtual host custom error log
If a virtual host is used in the Apache web server, the ErrorLog directive may be specified within the virtual host container, here In this case, the system-wide error log location mentioned above will be ignored.
After virtual hosts are enabled, each virtual host can define its own custom error log location. To find out the location of the error log for a specific virtual host, you can open /etc/apache2/sites-enabled/.conf and look for the ErrorLog directive, which displays the site-specific error log file.
The above is the detailed content of How to find custom error logs. For more information, please follow other related articles on the PHP Chinese website!