log my PHP errors (currently set to a file in php.ini) to a daily log

Hi all

This may be a simple request but nothing I've ever done before.

I currently have all my PHP errors logged to a file (windows) which is set in PHP.INI

I would like to know if its possible to log this to a new date stamped file daily rather than just this one file, and if so the code required please.

Thanks in advance

Neil ThompsonSenior Systems DeveloperAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Ray PaseurConnect With a Mentor Commented:
I think PHP will only write to the file named in the error log directive, which means you would need to change the directive every day - not very feasible.  You might set up a CRON job or scheduled task to find the error_log file(s) and rename them.  Run it every night at 11:59pm.
Neil ThompsonSenior Systems DeveloperAuthor Commented:
Excellent Idea Ray, saved again by out of the box thinking :)
Ray PaseurCommented:
Thanks for the points! ~Ray
All Courses

From novice to tech pro — start learning today.