A word of warning; if you use openlog() to ready syslog() and your Apache threads accept multiple requests, you *must* call closelog() if Apache's error log is configured to write to syslog. Failure to do so will cause Apache's error log to write to whatever facility/ident was used in openlog.
Example, in httpd.conf you have:
ErrorLog syslog:local7
and in php you do:
<?php
openlog("myprogram", 0, LOG_LOCAL0);
syslog("My syslog message");
?>
From here on out, this Apache thread will write ErrorLog to local0 and under the process name "myprogram" and not httpd! Calling closelog() will fix this.