logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Spitzer <aspit...@gmail.com>
Subject Re: How can I write a custom appender to supports Throwable as a second parameter?
Date Mon, 28 Sep 2009 19:57:40 GMT
hmmm.. so does this mean that if I want to define my own pattern
layout, it is not possible?

-alex spitzer




On Mon, Sep 28, 2009 at 3:50 PM, Simon Gibbs <simon.gibbs@cantorva.com> wrote:
> Alexander Spitzer wrote:
>
> log4j does not appear to append the stack trace onto the event before
> passing it onto my appender.  Here is a quick test I just did:
>
>     private void init_vars()
>     {
>         forcedLayout=new PatternLayout("%p %c %m");
>         init=true;
>     }
>
>
> This took me surprise... the clue was that the pattern code was "m" for
> message, which didn't seem to cover it.
>
> "The PatternLayout does not handle the throwable contained within
> LoggingEvents . Thus, it returns true."
>
> http://www.docjar.com/docs/api/org/apache/log4j/PatternLayout.html#ignoresThrowable
>
> Simon
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message