PDA

View Full Version : error_log method doesn't seem to write to a file


kmoore
07-28-2010, 04:58 PM
I'm having a hard time getting error_log to write messages to a file.

php.ini has this:

error_log = "/tmp/php_errors.log"

My page has this:

$errorLogResult = error_log("error log message");

I'm running Quercus as a WAR in Jboss, and I see the message in the Jboss console but I can't find any evidence of a file called php_errors.log.

I've also tried:

error_log = "php_errors.log"

Is this working for others?

kmoore
08-13-2010, 04:19 PM
Ticket 0004178: "error_log not working correctly with files" was created for this problem. That ticket was just closed, with a note referencing the documentation that implies that the function is working as specified.

Please re-open the ticket. The documentation for the message type argument ( http://php.net/manual/en/function.error-log.php ) states that:

"message is sent to PHP's system logger, using the Operating System's system logging mechanism or a file, depending on what the error_log configuration directive is set to. This is the default option. "

We have supplied the error_log configuration option, so it is an error if the log is not written to the file.

This is an issue for us because we have a large number of existing pages that use error_log. We would like the function to perform as documented, and as it does in native PHP.