I'm trying to get a PHP command line script to write informational messages to a custom file. I'm working on a MacBook with OSX Lion installed. I (now) have this in my syslog.conf file:
local2.error /var/log/myapp/error.log
local2.=warning /var/log/myapp/info.log
local2.=notice /var/log/myapp/info.log
local2.=info /var/log/myapp/info.log
local2.=debug /var/log/myapp/info.log
And I have this in my PHP script:
openlog("myapp", LOG_NDELAY, LOG_LOCAL2);
syslog(LOG_INFO, 'Testing informational messages with PHP');
closelog();
When I run the script, nothing is logged in /var/log/myapp/info.log, but (I think) it should be.
Thanks,
Troy