2008年9月23日星期二

Re: [fw-core] Zend_Log factory() proposition

On Tuesday 23 September 2008 17:14:18 Martin Roest - Ibuildings wrote:
> Hi,
>
> I'd like to do a proposition for a factory method in the Zend_Log that
> allows easy creation and configuration of the Zend_Log object.
>
> For example you have more than one logger and you want to be able to
> easily enable/disable the writers separately. Often we use multiple
> environments like staging, integration and production. ie. I want to
> write to a log file on production but disable the firePHP logging.
>
> Now we have something like this in our config.ini file:
>
> debug.log.file.class = "Zend_Log_Writer_Stream"
> debug.log.file.config.uri = "/<path>/<to>/application.log"
> debug.log.file.enabled = true
> debug.log.firebug.class = "Zend_Log_Writer_Firebug"
> debug.log.firebug.params = ""
> debug.log.firebug.enabled = false
>
> >From that we create a Zend_Config object and passes it to a factory
>
> method that will create the Zend_Log object.
>
> If find myself doing this for every project and it would be nice if we
> could incorporate it in the Zend_Log itself. To make it work we need to
> change a little bit in the stream writer but it can be kept backwards
> compatible.
>
> Its kinda similar to what is used with Zend_db.
>
> I'd happy to build it and provide patches.
>
>
> Let me know what you guys think.
>
>
> Regards,

This sounds like a great addition to Zend_Log, you'll get my thumbs up on
this. constructing the logger is somewhat tedious at the moment.

--
Benjamin Eberlei
http://www.beberlei.de

没有评论: