ZF-9790: allow to attach a formatter from .ini configuration and do not hardcode formatter class in Log_Writer class
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:
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.
$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...