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 Knut Urdalen <kn...@php.net> on 2009/08/01 00:39:52 UTC

Re: LoggerManager, Logger, LoggerHierarchy

Christian Grobmeier wrote:
> This is confusing. What should one use? Why two ways? I hardly see a
> benefit in having the LoggerManager class. Its just defining the
> classloader and references to the LoggerHierarchy.
>   
I've always been confused by this myself. I would prefer to go with one 
class: Logger
> I would like to remove the LoggerManager class since Log4PHP 2.0 isn't
> meant to be backward compatible. Instead, Logger should do the stuff.
>
> Are there any reasons not to do so from your point of view?
>   
I see no reasons (beside the BC break, but that shouldn't be a problem). 
I think everyone will accept this and it's even more in line with log4j 
which is a good thing :)

However, this is actually an important change that everyone should be 
aware of and it should be clear in any examples for log4php 2.0 that 
LoggerManager is deprecated/removed in favor of Logger. These are the 
lines users will have to change in their code when upgrading to 2.0.

Knut


Re: LoggerManager, Logger, LoggerHierarchy

Posted by Christian Grobmeier <gr...@gmail.com>.
> As the getLogger() method is probably the only one in LoggerManager that
> people are commonly using, we could leave a LoggerManager skelett that
> consists only of this single method. The left over method would call
> the preferred Logger::getLogger() and additionally prints a deprecation
> warning.
> This way old code would run but would tell itself how to fix it.
> This seems more user friendly that just let them search for a
> README file.

I can understand your point, but I think this is not necessary. If we
would leave such a skelett in it,
we would carry it around for a loooong time. I don't think this is
necessary with the 2.0 release.
If we would upgrade from 2.0 to 2.1, that would be another thing.

Other problems: people are forced to change code, cause they do need
to include the Logger class for classloading.
This ahs been done by LoggerManager before. I think it will not work
to have two classloaders in place nor do I think
it would be good to have an include statement in the LoggerManager class

But that is only my 2 cents - if there are other opinions around, speak up :-)

best,
Christian

Re: LoggerManager, Logger, LoggerHierarchy

Posted by Christian Hammers <ch...@lathspell.de>.
Am Sun, 2 Aug 2009 14:32:46 +0200
schrieb Christian Grobmeier <gr...@gmail.com>:

> > However, this is actually an important change that everyone should
> > be aware of and it should be clear in any examples for log4php 2.0
> > that LoggerManager is deprecated/removed in favor of Logger. These
> > are the lines users will have to change in their code when
> > upgrading to 2.0.
> 
> Good! Then we agree, I will have this done as next task, except you
> want to code it.
> 
> I also think we should create a webpage named "Upgrading to Log4PHP
> 2.0" in which we describe that change, as you suggested.

As the getLogger() method is probably the only one in LoggerManager that
people are commonly using, we could leave a LoggerManager skelett that
consists only of this single method. The left over method would call
the preferred Logger::getLogger() and additionally prints a deprecation
warning.
This way old code would run but would tell itself how to fix it.
This seems more user friendly that just let them search for a
README file.

bye,

-christian-

Re: LoggerManager, Logger, LoggerHierarchy

Posted by Christian Grobmeier <gr...@gmail.com>.
> However, this is actually an important change that everyone should be aware
> of and it should be clear in any examples for log4php 2.0 that LoggerManager
> is deprecated/removed in favor of Logger. These are the lines users will
> have to change in their code when upgrading to 2.0.

Good! Then we agree, I will have this done as next task, except you
want to code it.

I also think we should create a webpage named "Upgrading to Log4PHP
2.0" in which we describe that change, as you suggested.

Thanks,
Christian

>
> Knut
>
>