Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-09-26
3
Medium Priority
?
340 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 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 111

Expert Comment

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
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.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

670 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