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.no> on 2009/05/05 08:54:24 UTC

Exceptions

Hi,

Currently we don't throw any exceptions in log4php, but there's a few 
places where I think it makes sense to throw an exception. In example 
all configurators should yield an exception if something the provided 
configuration is wrong.

Should we introduce exceptions in log4php? If so where do we need it and 
what kinds of exceptions can you think of? I think it's useful to have a 
shared overview of where we want to throw exceptions.

Knut


Re: Exceptions

Posted by Knut Urdalen <kn...@php.no>.
Christian Grobmeier wrote:
> Agreed. I think a simple LoggerException with appropriate Message
> inside should do all tricks we need. I don't think a
> LoggerConfiguratorException is really necessary, but this is a matter
> of taste.
>   
Nothing else than that the name of the exception is more specific to 
what context it resolves to. I'll just use LoggerException for 
simplicity, I like it :)

Knut


Re: Exceptions

Posted by Christian Grobmeier <gr...@gmail.com>.
> Our prefix is "Logger". Which means we should have a LoggerException (base
> exception class for everything exception class needed in log4php) +
> LoggerConfiguratorException (for errors in configurators).
>
> I currently can't think of others. In general we should only throw
> exceptions during setup and not during the rest of the execution.

Agreed. I think a simple LoggerException with appropriate Message
inside should do all tricks we need. I don't think a
LoggerConfiguratorException is really necessary, but this is a matter
of taste.

Cheers
Christian


>
> Knut
>
>

Re: Exceptions

Posted by Knut Urdalen <kn...@php.no>.
Christian Grobmeier wrote:
>
> you are reading minds. I thought the same when I was under shower this morning.
>   
Hehe, probably one of the best places to think about open source 
contributions ;)
> I think too that we should introduce exceptions. Basically I don't
> think we need too much exceptions.
Cool
>  Next point worth of discussing is
> the naming. Imagine: ConfigurationException. This exception could be
> used by other people too which makes it difficult to include Log4PHP
> till namespaces are introduced. Maybe LogException will do the trick
> and I don't think we need much more exceptions since Log4php is so
> wonderful lightweight.
>   
Our prefix is "Logger". Which means we should have a LoggerException 
(base exception class for everything exception class needed in log4php) 
+ LoggerConfiguratorException (for errors in configurators).

I currently can't think of others. In general we should only throw 
exceptions during setup and not during the rest of the execution.

Knut


Re: Exceptions

Posted by Christian Grobmeier <gr...@gmail.com>.
Hi,

> Currently we don't throw any exceptions in log4php, but there's a few places
> where I think it makes sense to throw an exception. In example all
> configurators should yield an exception if something the provided
> configuration is wrong.

you are reading minds. I thought the same when I was under shower this morning.

> Should we introduce exceptions in log4php? If so where do we need it and
> what kinds of exceptions can you think of? I think it's useful to have a
> shared overview of where we want to throw exceptions.

I think too that we should introduce exceptions. Basically I don't
think we need too much exceptions. Next point worth of discussing is
the naming. Imagine: ConfigurationException. This exception could be
used by other people too which makes it difficult to include Log4PHP
till namespaces are introduced. Maybe LogException will do the trick
and I don't think we need much more exceptions since Log4php is so
wonderful lightweight.

Christian


>
> Knut
>
>