ZF-9331: Zend_Log should have event creation extracted to a method

Issue Type: Improvement Created: 2010-03-04T14:41:37.000+0000 Last Updated: 2010-08-08T05:11:37.000+0000 Status: Resolved Fix version(s): - 1.11.0 (02/Nov/10)

Reporter: David Abdemoulaie (hobodave) Assignee: Dolf Schimmel (Freeaqingme) (freak) Tags: - Zend_Log

Related issues: Attachments: - 9331.patch


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:

<pre class="literal">
$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 will not cause any BC breaks, and is harmless.


Posted by David Abdemoulaie (hobodave) on 2010-03-04T15:17:10.000+0000


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.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.