Am 08.06.2012 10:37, schrieb Ivan Habunek:
On 8 June 2012 10:14, Florian Semm<[email protected]> 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