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/22 14:18:52 UTC

RE: feature request: additional category methods that takeThrowab le objs

At 07:54 22.01.2001 -0500, John  Volkar wrote:
>Ceki,
>
>Couldn't he just create an ObjectRenderer for Thowable?  He could then
>just...
>         myCat.debug(someException);
>And the registered ObjectRenderer could do what he wants with it.
>
>Just a thought

John,

I think that would work. The remaining question is whether a 
ThrowableRenderer should be shipped with log4j and/or be registered by 
default.

You think you have locked the door but it sneaks through the window. Neat. Ceki

----
Ceki Gülcü (cgu@urbanet.ch)


Re: feature request: additional category methods thattakeThrowab le objs

Posted by Randall Ballew <rb...@intraware.com>.
That's exactly what I've done and it works fine with one exception --
PatternLayout/FileAppender leaves unwanted stack Trace in log file.
[Bug in FileAppender.subAppend()?]:
protected
       void subAppend(LoggingEvent event) {
          this.qw.write(this.layout.format(event));

          if(layout.ignoresThrowable()) {
/*
-------^^^^^^^^^^^^^^^^^^
Shouldn't this be: if(layout.ignoresThrowable() == false)) ?
 */
            if(event.throwable != null) {
               event.throwable.printStackTrace(this.tp);
            }
            // in case we received this event from a remote client
            else if (event.throwableInformation != null) {
                this.qw.write(event.throwableInformation);
            }
          }

Thanks,

Randy

Ceki Gulcu wrote:

> At 07:54 22.01.2001 -0500, John  Volkar wrote:
> >Ceki,
> >
> >Couldn't he just create an ObjectRenderer for Thowable?  He could then
> >just...
> >         myCat.debug(someException);
> >And the registered ObjectRenderer could do what he wants with it.
> >
> >Just a thought
>
> John,
>
> I think that would work. The remaining question is whether a
> ThrowableRenderer should be shipped with log4j and/or be registered by
> default.
>
> You think you have locked the door but it sneaks through the window. Neat. Ceki
>
> ----
> Ceki Gülcü (cgu@urbanet.ch)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org

--
Randy Ballew, Senior Application Architect, Intraware, Inc.
    925.253.4507
    rballew@intraware.com



RE: feature request: additional category methods that takeThrowab le objs

Posted by msew <ms...@ev1.net>.
At 14:18 01/22/2001 +0100, you wrote:
>The remaining question is whether a ThrowableRenderer should be shipped 
>with log4j and/or be registered by default.


if yes to those then why not in the Category class? :-)