You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ceki Gulcu <cg...@urbanet.ch> on 2001/01/18 20:56:24 UTC

Re: feature request: additional category methods that takeThrowable objs

At 13:47 18.01.2001 +0000, you wrote:


>Ceki Gulcu wrote:
> >
> > You got bitten by this today? Are you suggesting that this keeps happening?
> > I wonder if it happens consistently to other users... Ceki
> >
>Hi,
>
>I've just started using log4j - been aware of it for some time but was
>waiting to see if the java logging apis came to anything and whether
>any worthwhile standard would emerge. I converted my first lot of code
>yesterday and this was one of the first things I noticed, as I was
>converting catch blocks with a single "e.printStackTrace()" in them to
>use the logger and had to think up suitable messages for the first
>parameter. I looked through the Category api and was also mildly
>surprised to see that there were no methods purely for logging
>exceptions. In a lot of try/catch blocks I have a last catch for
>Throwable or Exception and having to put in the message "Unexpected
>exception while <blah>" doesn't really seem to add that much. Whether
>it's preferable to *always* have some message or not I don't know, but
>it might be better to have the option of doing either.

I am aware that the lack of methods for printing an exception without an 
accompanying message surprises new users. Every tool has its idiosyncrasies 
and log4j has its own rich set of quirks. In this particular case I believe 
that the tradeoff is between better usability and lesser API consistence as 
an exception is treated completely independently from the log message 
passed as a parameter. I wanted to avoid giving the impression that an 
exception could somehow be the log message. However, if that is the 
behavior users naturally expect, then log4j should offer the additional 
exception printing methods. You can expect this addition for the next release.


>In any case it's a small point and I'd like to say I was very pleased
>with it and the overall design and configuration stuff. Nice and easy
>to use and stillv very powerful. I've been delaying putting proper
>logging into my code for some time and it feels good to finally have
>got it together and made the decision on what to use. With log4j being
>part of the jakarta project now I'm sure it's bound to catch on more
>widely and become a de facto standard. Do you know if there are any
>plans to use it in any of the other projects, like tomcat? I've noticed
>it comes with the JBoss EJB server, but not sure to what extent it's
>used there.

I have heard through the grapevine that Tomcat and a bunch of other 
projects are switching to log4j but I am really not a reliable source. :-)

I did not know that jBoss came with log4j? jBoss 2.0 is not shipped with 
it. Which version are you referring to? Cheers, Ceki

---
Freedom as in the capacity to exercise choice.


Re: feature request: additional category methods thattakeThrowable objs

Posted by Luke Taylor <ne...@freesurf.ch>.

Ceki Gulcu wrote:
> 
> At 13:47 18.01.2001 +0000, you wrote:
> 
> >Ceki Gulcu wrote:
> 
> I did not know that jBoss came with log4j? jBoss 2.0 is not shipped with
> it. Which version are you referring to? Cheers, Ceki
> 

Thanks for the info.

The current pre-2.1 version of jboss from cvs has log4j.jar included.
It's not referenced in the source anywhere, but seems to be referenced
in "exolab" whatever that is.

Luke.


-- 
 Luke Taylor.
 PGP Key ID: 0x57E9523C