Edit report at http://bugs.php.net/bug.php?id=52052&edit=1
ID: 52052 Comment by: f...@php.net Reported by: ef-lists at email dot de Summary: add syslog support to FPM Status: Assigned Type: Feature/Change Request Package: FPM related Operating System: Linux/*NIX PHP Version: 5.3SVN-2010-06-11 (SVN) Assigned To: fat New Comment: Thanks for the reporting. I'll check that and answer you as soon as possible. Previous Comments: ------------------------------------------------------------------------ [2010-07-07 12:27:54] ef-lists at email dot de Sorry it took me so long to reply. Too much work and too few spare time. Netherless I reviewed the patch and fixed some problems. If trace failed in fpm_php_trace.c:fpm_php_trace, there was a call to fwrite with a NULL pointer. Added syslog here. In fpm_stdio.c:fpm_stdio_init_child a close was performed on the fd set to ZLOG_SYSLOG. (valgrind complained) In fpm_stio.c:fpm_stdio_open_error_log, the variable syslog shadowed syslog() - renamed it to syslog_opened. It didn't matter from the code's point of view, but I think shadowing is a bad thing and renaming avoids it and also doesn't emit a warning, if you compile with -Wshadow. In php-fpm.conf.in was a typo (syslog_syslog_level -> slowlog_syslog_level). Four more questions regarding the patch: 1) Is there a particular reason, why the facility names are partially compared with strcasecmp and strcmp? I found it confusing, that I have to type LOCAL6 instead of local6. 2) When looking at php_syslog.h - for maximum portability, shouldn't the syslog() calls be changed to php_syslog()? 3) I'm unsure - but aren't we losing messages from libevent written to stderr in the master process? I think one could use the fpm event system, to catch stderr, but didn't investigate further yet. 4) Are you planning to integrate this patch into SVN? Oh and besides the issues I mentioned - the patch works fine for me. :-) Regards, Edgar ------------------------------------------------------------------------ [2010-06-13 11:03:33] f...@php.net my mistakes. The v2 patch was buggy. Use v3 instead. ------------------------------------------------------------------------ [2010-06-13 11:03:00] f...@php.net The following patch has been added/updated: Patch Name: fpm-syslog.v3.patch Revision: 1276419780 URL: http://bugs.php.net/patch-display.php?bug=52052&patch=fpm-syslog.v3.patch&revision=1276419780 ------------------------------------------------------------------------ [2010-06-13 10:41:26] f...@php.net You can try instead the new revision of the patch I've just attached. It adds sending slowlog to syslog. Set slowlog to syslog. Moreover you can set slowlog_syslog_level to same values as log_level. By default it's LOG_DEBUG. There is no way to change the ident and the facility for slowlog, it takes the same values as the globals ones (syslog_facility and syslog_event). There is no need to because the pool name is prepended to every slowlog message. ------------------------------------------------------------------------ [2010-06-13 10:36:27] f...@php.net The following patch has been added/updated: Patch Name: fpm-syslog.v2.patch Revision: 1276418186 URL: http://bugs.php.net/patch-display.php?bug=52052&patch=fpm-syslog.v2.patch&revision=1276418186 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=52052 -- Edit this bug report at http://bugs.php.net/bug.php?id=52052&edit=1