Details
Description
It would be great if we could attach a formatter directly through application.ini file AND without having to subclass a writer either.
Currently we can define the following entries for Zend_Log:
"application.ini"
resources.log.stream.writerName = "Stream" resources.log.stream.writerParams.stream = APPLICATION_PATH "/../logs/app.log" resources.log.stream.writerNamespace = "Library_Log_Writer" resources.log.stream.filterName = "Priority" resources.log.stream.filterParams.priority = Zend_Log::WARN // It would be great if we could add something like: resources.log.stream.formatterName = "MyFormaterName" resources.log.stream.formatterNamespace = "My_Formater_Namespace"
This would improve logging customization a lot and make it easier.
It would be absolutely necessary to remove currently hardcoded formatter classes within Writer classes.
"Zend_Log_Writer_Stream::__construct()"
$this->_formatter = new Zend_Log_Formatter_Simple();
=> currently, to attach your own formatter, you have to create your own subclass of Writter_Stream... Not very flexible...
Attachments
Issue Links
| This issue duplicates: | ||||
| ZF-9176 | Zend_Log::factory() does not support formatters |
|
|
|
Not sure if is really necessary to extend a Writer. Just setting a Formatter to the current Writer doesn't does the trick?