I have the following basic code:
<?php
//http://localhost/error_log.php
echo "write to the error_log";
error_log("error_log entry");
//error_log("error_log entry",0);
?>
When I navigate to this page, I see write to the error_log in the browser. It even appears in the access_log /var/log/apache2/access.log.
[my ip here] - - [18/Jan/2013:09:18:54 +0000] "GET /error_log.php HTTP/1.1" 200 314 "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"
but when I check the error_log i.e. /var/log/apache2/error.log, I don’t see either of the error_log messages.
Why are these not getting entered into the error_log?
You call it without a second parameter, this means default is 0
Now it depends on the configuration of error_log.
If here is not “stderr”, php will not log into the apache error log.
It seams to be “syslog” of this php send your log message to the syslog.
Now it depends on how you rsyslog.d is configurated.
But have look at folling logs
You message should be in one of them.