Solved

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

Posted on 2014-09-26
3
281 Views
Last Modified: 2014-09-26
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
Comment
Question by:NeilT
  • 2
3 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
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
 
LVL 3

Author Comment

by:NeilT
Comment Utility
Excellent Idea Ray, saved again by out of the box thinking :)
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
Thanks for the points! ~Ray
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

#SSL #TLS #Citrix #HTTPS #PKI #Compliance #Certificate #Encryption #StoreFront #Web Interface #Citrix XenApp
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now