note 33676 added to function.syslog
| From: | monte at ispi dot net | Date: | Thu, 03 Jul 2003 16:05:07 +0000 |
| Subject: | note 33676 added to function.syslog | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51469@lists.php.net to get a copy of this message | ||
If you have php.ini setup to send PHP errors to syslog, they will all get dumped into
/var/log/messages (at least it does with RedHat 9 by default). I wanted to figure out how to get PHP
errors to go to their own syslog file.
After some trial and error, I figured out what facility and priority PHP uses, which is
"user.notice". So, to get your PHP errors going to a separate syslog file, put this line
in your /etc/syslog.conf :
user.notice /var/log/php.log
Then restart syslogd:
/etc/init.d/syslog restart
Why PHP uses "user" as the facility I'm not sure, probably because it's the only
one that works under Windows?
Monte
----
Manual Page -- http://www.php.net/manual/en/function.syslog.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33676
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33676&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33676&report=yes