Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • Last Modified:

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
0
Neil Thompson
Asked:
Neil Thompson
  • 2
1 Solution
 
Ray PaseurCommented:
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.
0
 
Neil ThompsonSenior Systems DeveloperAuthor Commented:
Excellent Idea Ray, saved again by out of the box thinking :)
0
 
Ray PaseurCommented:
Thanks for the points! ~Ray
0

Featured Post

Lessons on Wi-Fi & Recommendations on KRACK

Simplicity and security can be a difficult  balance for any business to tackle. Join us on December 6th for a look at your company's biggest security gap. We will also address the most recent attack, "KRACK" and provide recommendations on how to secure your Wi-Fi network today!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now