Several things/options here. That article doesn't mention configuring php.ini to use syslog for error logging inside of php. You'll need to set
error_log = syslog
I'm assuming that was alluded to in the article where it says
PHP has a annoying habit of logging everything with the NOTICE error
level.
You could turn on error logging to syslog that way and follow the syslog voodoo suggested in that article, or you could do it the PHP way, and by that I mean using more of PHP to implement the mapping between PHP errors & syslog error levels.
Define a custom error handler via set_error_handler, then within the handler, map a particular PHP error to some particular syslog error level eg
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
if (!(error_reporting() & $errno)) {
// This error code is not included in error_reporting
return;
}
switch ($errno) {
case E_USER_ERROR:
$str = "<b>My ERROR</b> [$errno] $errstr<br />\n" .
" Fatal error on line $errline in file $errfile" .
", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n" .
"Aborting...<br />\n";
syslog(LOG_CRIT, $errstr)
exit(1);
break;
case E_USER_WARNING:
// ...
}
It might also be a neat idea to do the same with set_exception_handler.