Feedbacks/issues of Zend_Log for ZF1
- More flexible mapping ror Zend_Log_Writer_Db ZF-2658
- Zend_Log_Formatter_Simple must print %info% event ZF-10427
- Incorrect handling of E_DEPRECATED and E_USER_DEPRECATED ZF-12031
- Patch to make line and file information available in log events ZF-2428
- Add Zend_Log::getWriters() to return list of attached writers ZF-3581
- Create the log file only if there is something to log ZF-5741
- Add callback support for log events ZF-7959
- Filtering messages which are not strings ZF-5778
- Methods to remove log writers, filters and event items. ZF-1833
Feddbacks/issues of Zend\Log for ZF2
- Array arguments get flattened when creating Zend\Log\Logger ZF2-34
- Reflection is used in Zend_Log::__construct() to build priorities name (slow)
- Magic method __call() used for shortcut log an event (slow, and hard to discover API)
- Bad design for Zend_Log::factory() (it calls others factories of writer/formatter/filter defined in config)
Proposals
- API discoverable (emerg, alert, crit, err, warn, notice, info, debug)
- Improve Simple Formatter (according to the feedbacks/issues)
- Use the plugin broker to review factory (Zend\Loader\Broker, Zend\Loader\Pluggable)
- Use of SplPriorityQueue to manage multiple writers (with priorities)
- New formatter (json)
- Add a Zend\Log\Filter\Validator to use a Zend\Validator object like "filter" for the log message
- Create LoggerAware for Di
- Renderer for exceptions, array, string object, event, etc (format exception instead of __toString())
- Modify parameters of Logger::log($priority, $message, $extras)
- Rename Filter\Message in Filter\StringMatch or Filter\Regex
1 Comment
comments.show.hideNov 15, 2011
Matthew Weier O'Phinney
There were a few features discussed in IRC and also in ZF1 that I'm not sure are addressed.
In ZF1, you could have multiple writers. Each writer could indicate which priorities it was interested in, as well as filter on messages to determine interest. Will that behaviour still exist?
There were folks asking on IRC if individual writers could be instantiated standalone, and/or attached to a logger instance and retrieved by name, so as to allow logging directly to a specific writer.
Regarding custom priorities, I think we already can support it, if the main method is "log($message, $priority, $extras)". The question is if the priority provided needs to have a string representation, in which case having some sort of priority map may be interesting.
Over all, however, the direction looks fine for starting development.