• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Question Change error log location

Kaspar

API expert
Plesk Guru
I'd like to change the location PHP error log file to the same directory as the PHP file that caused the error.

So for example if a PHP file resides in domainname.com/httpdocs/classes/ and a error occurs a error log file is created in the same directory. This seems a bit harder to achieve than I anticipated.

I have been able to change the error log location to the document root of the domain by setting: error_log = "{DOCROOT}{\}error_log" in the PHP ini file. But I am not sure how to change the error log setting to use the same directory as the PHP file that caused the error.

Any one has any suggestions?
 
I don't think that's easily possible. You would have to create your own PHP framework and instruct all your PHP scripts to output any errors to a dynamic log file location. But then again I'm not a coder.

Anway, I would recommend to keep your PHP error logs outside of the document root, as they may contain sensitive information and you probably don't want anybody to be able to read your logs....
 
This is also a bad idea because a huge error log file can very quickly take up disk space on your domain, and therefore the domain will be suspended due to limit overusage.
 
Back
Top