Req #17753 [Asn]: Suport lineFormat for syslog writer
| From: | php at tyra dot ch | Date: | Thu, 26 Aug 2010 06:36:17 +0000 |
| Subject: | Req #17753 [Asn]: Suport lineFormat for syslog writer | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-4682@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: php@tyra.ch
Reported By: php at tyra dot ch
Summary: Suport lineFormat for syslog writer
Status: Assigned
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:
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.
Previous Comments:
------------------------------------------------------------------------
[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