On Fri, Nov 23, 2012 at 5:36 PM, businessdad
<[email protected]> wrote:
>
>
> On Fri, Nov 23, 2012 at 4:26 PM, Christian grobmeier [via Apache Logging]
> <[hidden email]> wrote:
>>
>> On Fri, Nov 23, 2012 at 4:38 PM, businessdad
>> <[hidden email]> wrote:
>>
>> in my opinion, a logging framework should never cause an application
>> to fail. If you do that, it might happen that you reconfigure logging
>> in production and - due to an error - you production app stops jus
>> because of your logging framework. This is not nice too.
>>
>> That said, it is actually very easy if you still prefer require
>> instead of included.
>>
>> You could exchange this file:
>>
>> http://svn.apache.org/repos/asf/logging/log4php/trunk/src/main/php/LoggerAutoloader.php
>>
>> Another option is to patch log4php in such a way, the user can decide
>> between require and include with some kind of ini parameter.
>>
>> What do you think?
>
>
> The issue is precisely that, due to the include, Logger carries on also when
> required classes are not loaded. Logger cannot work without LoggerHierarcy,
> and it fires a fatal error when it tries to instantiate it. That means
> backtracing the issue, just to find out that the file was not loaded.
>
> A Logger is a fundamental part of a system, not a fancy optional one like an
> animated menu. If the Logger doesn't work, it should raise an error. Having
> a website that keeps going on without anyone noticing that something is
> broken is worse than having it stopped.
>
> Besides, any call to the Logger would fail anyway, triggering an error, like
> in my case. Very simply, it would be easier to be informed of the root cause
> (file can't be loaded) straight away, rather than having to figure it out
> because some class doesn't exist.

Fair enough. Let's hear what Ivan says (the guy who does coding mainly
these days)

> About changing the Autoloader: I've done it already, together with several
> other minor changes, but thanks for the suggestion. :)

Hey, what about donating a patch to your favorite logging project? :-)
We are always eager to get improvements into our code base. If you
need help with that, let us know.

Cheers
Christian


>
> ________________________________
> View this message in context: Re: LoggerAutoloader - Why "include" and not
> "require"?
>
> Sent from the Log4php - Dev mailing list archive at Nabble.com.



--
http://www.grobmeier.de
https://www.timeandbill.de

Reply via email to