ZF-9331: Zend_Log should have event creation extracted to a method
Description
I recently found myself needing to use {{Zend_Log}} to create entries with a UTC timestamp (using {{gmdate()}}). However, in order to do this with the existing {{Zend_Log}} I have to override the entire 50 line {{Zend_Log::log()}} method, which makes my subclass very brittle.
I propose moving the event creation to a method like so:
$event = $this->_packEvent($message, $priority);
// ...
protected function _packEvent($message, $priority)
{
return array_merge(array(
'timestamp' => date('c'),
'message' => $message,
'priority' => $priority,
'priorityName' => $this->_priorities[$priority]),
$this->_extras
);
}
This will not cause any BC breaks, and is harmless.
Comments
Posted by David Abdemoulaie (hobodave) on 2010-03-04T15:17:10.000+0000
Patch
Posted by Ramon Henrique Ornelas (ramon) on 2010-08-07T18:12:18.000+0000
I think that this issue can be closed assigned fix version to minor release, the patch was applied in r21331.