Req #51118 [PATCH]: Allow multiple simultaneous syslog connections
| From: | fat@php.net | Date: | Sun, 30 Jan 2011 10:58:01 +0000 |
| Subject: | Req #51118 [PATCH]: Allow multiple simultaneous syslog connections | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158337@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51118&edit=1
ID: 51118
Patch added by: fat@php.net
Reported by: sylvain at abstraction dot fr
Summary: Allow multiple simultaneous syslog connections
Status: Open
Type: Feature/Change Request
Package: *General Issues
Operating System: all
PHP Version: 5.2.12
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: php-syslog.patch
Revision: 1296385081
URL:
http://bugs.php.net/patch-display.php?bug=51118&patch=php-syslog.patch&revision=1296385081
Previous Comments:
------------------------------------------------------------------------
[2011-01-29 14:03:14] fat@php.net
I've just updated the patch with a compliant trunk patch.
------------------------------------------------------------------------
[2011-01-29 14:02:29] fat@php.net
The following patch has been added/updated:
Patch Name: php_syslog_multiple_context.patch
Revision: 1296306149
URL:
http://bugs.php.net/patch-display.php?bug=51118&patch=php_syslog_multiple_context.patch&revision=1296306149
------------------------------------------------------------------------
[2010-07-23 13:11:41] sylvain at abstraction dot fr
Thank you very much for your time.
Hope it will be accepted in trunk.
Regards.
------------------------------------------------------------------------
[2010-07-23 05:30:28] fat@php.net
I just attached a patch which should do the trick. I don't know if it'll
be
accepted by the dev team who handle this part of PHP.
openlog() returns a ressource instead of a bool.
closelog() and syslog() have now a last and optional parameter: a
context
ressource.
Everything which was working before, should still work. The only change
is the
return value of openlog() which should be strictely compared
(openlog(...) !==
true).
here is a sample test script:
<?php
syslog(LOG_ERR, "test 1 on ressource #0");
// Jul 23 05:20:22 wild php: test 1 on ressource #0
$r1 = openlog("test syslog #1", LOG_PID, LOG_SYSLOG);
$r2 = openlog("test syslog #2", LOG_PID, LOG_SYSLOG);
syslog(LOG_ERR, "test on ressource #1", $r1);
// Jul 23 05:20:22 wild test syslog #1[24144]: test on ressource #1
syslog(LOG_ERR, "test on ressource #2", $r2);
// Jul 23 05:20:22 wild test syslog #2[24144]: test on ressource #2
closelog($r1);
closelog($r2);
syslog(LOG_ERR, "test 2 on ressource #0");
// Jul 23 05:20:22 wild php[24144]: test 2 on ressource #0
openlog("test syslog #0", LOG_PID, LOG_SYSLOG);
syslog(LOG_ERR, "test 3 on ressource #0");
// Jul 23 05:20:22 wild test syslog #0[24144]: test 3 on ressource #0
closelog();
syslog(LOG_ERR, "test 4 on ressource #0");
// Jul 23 05:20:22 wild php[24144]: test 4 on ressource #0
?>
------------------------------------------------------------------------
[2010-07-23 05:23:41] fat@php.net
The following patch has been added/updated:
Patch Name: php_syslog_multiple_context.patch
Revision: 1279855421
URL:
http://bugs.php.net/patch-display.php?bug=51118&patch=php_syslog_multiple_context.patch&revision=1279855421
------------------------------------------------------------------------
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=51118
--
Edit this bug report at http://bugs.php.net/bug.php?id=51118&edit=1