You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by Florian Semm <fl...@gmx.de> on 2012/06/08 10:14:45 UTC

Loggerconfiguration

Hey,

some weeks ago Michael Sole talk about a new/more intuitive way for the 
logger-configuration. I talk with some colleagues and they have the same 
opinion: large associated arrays are bad.

My idea is to use objects for the configuration. There are for each 
component (layout, appender) concrete configuration-classes.

https://gist.github.com/2894414

What do you think?

Regards

Florian

Re: Loggerconfiguration

Posted by Florian Semm <fl...@gmx.de>.
Am 08.06.2012 10:37, schrieb Ivan Habunek:
> On 8 June 2012 10:14, Florian Semm<fl...@gmx.de>  wrote:
>> Hey,
>>
>> some weeks ago Michael Sole talk about a new/more intuitive way for the
>> logger-configuration. I talk with some colleagues and they have the same
>> opinion: large associated arrays are bad.
> Hm, just noticed that conversation. Missed it somehow.
>
>> My idea is to use objects for the configuration. There are for each
>> component (layout, appender) concrete configuration-classes.
>>
>> https://gist.github.com/2894414
>>
>> What do you think?
> I'm not outright against such a thing, but I'm not sure why it's
> useful. Why not just configure log4php programatically:
> http://logging.apache.org/log4php/docs/configuration.html#Programmatic_configuration
>
> The code even looks similar to your gist. :)
>
> Configuration objects would add another abstraction layer, and I'm not
> convinced what the benefits would be.

My basic idea was to avoid large arrays. While I have written the gist, 
I noticed that code looks like the real API of components. So I want to 
know your opinion about this topic. ;)

The configuration via objects is more inituitive. You doesn't need to 
know anythink about the API of an appender. Maybe this abstraction layer 
is YAGNI and the programmatic-configuration is enouth. It makes also the 
whole application more complex.

> Regards,
> Ivan


Re: Loggerconfiguration

Posted by Ivan Habunek <iv...@gmail.com>.
On 8 June 2012 10:14, Florian Semm <fl...@gmx.de> wrote:
> Hey,
>
> some weeks ago Michael Sole talk about a new/more intuitive way for the
> logger-configuration. I talk with some colleagues and they have the same
> opinion: large associated arrays are bad.

Hm, just noticed that conversation. Missed it somehow.

> My idea is to use objects for the configuration. There are for each
> component (layout, appender) concrete configuration-classes.
>
> https://gist.github.com/2894414
>
> What do you think?

I'm not outright against such a thing, but I'm not sure why it's
useful. Why not just configure log4php programatically:
http://logging.apache.org/log4php/docs/configuration.html#Programmatic_configuration

The code even looks similar to your gist. :)

Configuration objects would add another abstraction layer, and I'm not
convinced what the benefits would be.

Regards,
Ivan