logging-log4php-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Habunek <ivan.habu...@gmail.com>
Subject Re: Default-Layout
Date Sun, 27 Nov 2011 11:08:07 GMT
On 26 November 2011 19:09, Florian Semm <florian.semm@gmx.de> wrote:
> I have implemented this case. But there's a problem: if this will
> implemented in the activateOptions() method, you have to modify all
> appenders which overwrite this method. The createAppenderLayout() method in
> the LoggerConfigurator is a better place. You can call there a method like
> getDefaultLayout() or a static variable.

I can see the problem. I wanted to keep the solution within the
appender class because, if it's defined in the configurator, then the
default layout will not be applied when configuring programatically.

For example, this would not work becuase the layout is not specified:
$app = new LoggerAppenderEcho();

Maybe we can implement it so default layout is set automatically in
Appender's constructor. The configurator will override the default
layout if it's specified in the config file. This way it works
programatically, but it would be just slightly slower, because the
layout would potentially be set twice.

On the other hand, I don't suppose a lot of people will configure
log4php programatically...

On the third hand, we haven't done any performance tuning at all so
the framework is not very optimised to start with, and this minor
performance penalty will not be detectable. :)

What do you think is the better solution?


View raw message