• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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