> After reading http://logging.apache.org/log4j/1.2/manual.html I'm
> wondering why we should need a setConfiguration() or those deprected
> variables at all.

Good point

> The documented behaviour for those cases is:
>
>     PropertyConfigurator.configure(args[0]);
>     BasicConfigurator.configure();
>
> which both look as if they could be used in PHP the same way.

That might be true... however, i consider this a bit ugly. I think
that BasicConfigurator (without looking into Log4js code) will get
another singleton, creates a singleton of its own and puts itself into
it. Or something like that. Its really a singleton-mania :-)

I would prefer:
Logger::setConfigurator( new BasicConfigurator());
Logger::setPropertyConfigurator( new PropertyConfigurator(), $myPropertyArray);

for the above. This brings us more into the dependency injection
thought. And we would get rid of all that static stuff.
Its basically doing the same like you quoted above from the docs, but
I think in a more clean way.

Wdyt?

Christian

Reply via email to