PHP Output to Syslog on Ubuntu
posted by Paul on Thursday, November 26, 2009
There are just a few things you need to know in order to output trace or error information to syslog on an Ubuntu system (the following is probably true for other Debian-based distributions, too) from PHP.
-
Set error logging to
sysloginphp.ini(the system-widephp.inican be found at/etc/php5/php.ini):error_log = syslog
-
Restart Apache:
$ sudo /etc/init.d/apache2 restart
-
Use the
error_log()function to output your error messages. -
View the output of error messages:
$ tail -f /var/log/syslog
The-fflag causes new messages to be appended to the output oftail.
Labels: PHP, programming, syslog, Ubuntu
0 Comments:
Post a Comment