Req #17753 [Asn->Csd]: Suport lineFormat for syslog writer
| From: | jon@php.net | Date: | Thu, 26 Aug 2010 07:30:44 +0000 |
| Subject: | Req #17753 [Asn->Csd]: Suport lineFormat for syslog writer | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-4684@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=17753&edit=1
ID: 17753
Updated by: jon@php.net
Reported By: php at tyra dot ch
Summary: Suport lineFormat for syslog writer
-Status: Assigned
+Status: Closed
Type: Feature/Change Request
Package: Log
Operating System: Linux Ubuntu 10.04
Package Version: 1.12.1
PHP Version: 5.3.2
Assigned To: jon
Roadmap Versions:
New Comment:
-Status: Assigned
+Status: Closed
This bug has been fixed in SVN.
If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should
be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
Previous Comments:
------------------------------------------------------------------------
[2010-08-26 06:36:16] tyra
I guess the best solution is to add the following line of code to the
file 'syslog.php' around line 140 after '$message =
$this->_extractMessage($message);':
/* Build the string containing the complete log line. */
$line = $this->_format($this->_lineFormat,
strftime($this->_timeFormat),
$priority, $message) . $this->_eol;
of course then '$this->_lineFormat' need to be supported (I would do it
analog to file.php):
- have the variable defined in the top:
/**
* String containing the format of a log line.
* @var string
* @access private
*/
var $_lineFormat = '%1$s %2$s [%3$s] %4$s';
- in the constructor have the following lines:
if (!empty($conf['lineFormat'])) {
$this->_lineFormat =
str_replace(array_keys($this->_formatMap),
array_values($this->_formatMap),
$conf['lineFormat']);
}
I hope this clarifies what I meant.
------------------------------------------------------------------------
[2010-08-24 06:24:06] jon
-Assigned To:
+Assigned To: jon
------------------------------------------------------------------------
[2010-08-20 01:59:28] doconnor
Hi Tim,
Can you expand on it a little more for us bug triagers who aren't
familiar with the package?
IE: an example of what you can do with a current driver and what the
syslog driver currently does/does not do?
------------------------------------------------------------------------
[2010-08-19 19:12:50] tyra
Description:
------------
All writers have support for lineFormat via _format except for the
syslog writer. It would be great if syslog lines could also show
additional parameters like file, function or class.
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=17753&edit=1