We are getting "Allowed memory exhausted with PHP" where PHP is asking for Gigabytes of memory. How can I format the Apache error log to see which URL it was accessing ?
taken from the debian apache2.conf default file:
in short :
Define the output format in your main config file and the output file for example per vhost in the VirtualHost Directive. You can define the config file for all your sites in the main file aswell, if you want to.
something like would be needed to add (in case its not there yet):
Depending on your exact setup you might want to change the location slightly.
Dont forgot to logrotate them if you have a high traffic site.
Normally this should be (at least in debian) the default setting for how i remember it.
If you have empty logs you might want to check the permissions of the folder/files so that the user the apache2 process runs under can access and write to them.
Remember a reload of the process is (for what i know) needed for rereading the configuration files.
The accepted answer does not answer the original question as it logs to access.log and not to error.log
you need to put the url in an environment variable and then call it from ErrorLogFormat like this: