Any way to capture errors in a file?
Posted: Sat Mar 15, 2008 5:22 pm
Here's a simple question: Right now, PHP displays errors right in the output it is generating, like:
This is really a pain because I'm working on something which interacts over XML, so the only way for me to see these errors is to use TCPFLOW to capture packets as I run tests. That is beyond annoying and is an awful way to do development.
Reading the manual, I saw that I can use:
It has no effect. The errors still go into the output.
This shouldn't be hard... there must be some way of also dumping errors into a file? PHP has been around for years. I can't be the only one who wants to capture errors in a log, right?
Code: Select all
<br />
<b>Warning</b>: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for userReading the manual, I saw that I can use:
Code: Select all
ini_set("log_errors", true);This shouldn't be hard... there must be some way of also dumping errors into a file? PHP has been around for years. I can't be the only one who wants to capture errors in a log, right?