Solved

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

Posted on 2014-09-26
3
291 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:Neil Thompson
  • 2
3 Comments
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 40346317
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:Neil Thompson
ID: 40346340
Excellent Idea Ray, saved again by out of the box thinking :)
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 40346419
Thanks for the points! ~Ray
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
#SSL #TLS #Citrix #HTTPS #PKI #Compliance #Certificate #Encryption #StoreFront #Web Interface #Citrix XenApp
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

786 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