I have a PHP page that I want to have errors and info logged to a file. I setup the OpenLog and Syslog functions and they work, but they only log to the Syslog and not to the facility I defined (example below).
<?php
Openlog("PHP-Page", LOG_NDELAY, LOG_LOCAL5);
// Code Here
Syslog(LOG_INFO, "User logged in from $rip.");
// More Code
Closelog();
?>
Everything else in the page works as it should, except for the logging location. The logging shows up as I wanted, but it doesn't log to Local5 only Syslog. I am on Debian 7 running LigHTTPd 1.4.31 and PHP 5.4.36. Below is the entry in my rsyslog.conf.
local5.* /var/log/phppage.log
The permissions on the file are as follows.
-rw-r--r-- 1 root root 0 Mar 4 04:02 phppage.log
I use Webmin to manage the server and it created the log file when I set it up in Syslog from Webmin. Webmin also generate the rsyslog entry.
Any thoughts on why this is happening? I haven't been able to find anything to indicate a write error or anything like that.