Edit report at http://bugs.php.net/bug.php?id=52052&edit=1

 ID:                 52052
 User updated by:    ef-lists at email dot de
 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
 Block user comment: N
 Private report:     N

 New Comment:

Hi,



added a new patch, which can be applied to a vanilla PHP 5.3.5.



compiles and runs with:

--enable-debug without relevant warnings

--enable-maintainer-zts

without other flags

with having HAVE_SYSLOG_H in main/php_config.h undefined



changes:

* modified patch to work with FPM in 5.3.5

* added new parameters to config dump (todo: translate syslog prio and
facility to nice human-readable values)

* made comparing syslog facilities case-insensitive

* replaced syslog() calls with php_syslog()



Regards,

Edgar


Previous Comments:
------------------------------------------------------------------------
[2011-01-12 16:15:58] ef-lists at email dot de

Hi Jerome,



are there any updates on this issue yet? With PHP 5.3.4 and PHP 5.3.5
the latest patch doesn't work anymore.



I'd be willing to port it to the latest release, if you're interested.
I'd still like to see this integrated into trunk and 5.3.X.



Regards,

Edgar

------------------------------------------------------------------------
[2010-07-22 23:37:45] f...@php.net

some answers to your questions:



1- this is a bug. All comparaison should use strcasecmp so that users
can type 

facilities and log level with the case they want.



2- you're right. php_syslog() should be used instead of syslog()



4- after testing and validating, yes of course.



I need to take time reviewing all this. Thx again !

------------------------------------------------------------------------
[2010-07-07 13:17:07] f...@php.net

Thanks for the reporting. I'll check that and answer you as soon as
possible.

------------------------------------------------------------------------
[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.

------------------------------------------------------------------------


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

Reply via email to