Php – Centralizing PHP error logging with syslog

log-filesloggingPHPsyslog

I have a PHP application that is running on 20 web servers. It's silly to check every servers' PHP error log. I'm planning to centralize the error logging on one (not a web server, a server just used for monitoring).

PHP does support logging to syslog by doing a simple change "error_log = syslog". Then I will configure syslogd to log to my central server.

Did anybody try this before? Any recommendation? Anything I should be careful of? Would this affect performance?

Best Answer

Yes, I've done this. It works well, and doesn't have any real gotchas. Performance isn't an issue unless you're logging so many errors that you really want to be fixing some of them anyway, or you're logging to a really remote network location (which is a bad idea for all sorts of reasons).

Related Topic