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 DE BENEDICTIS DAVIDE <dd...@sogei.it> on 2005/03/01 11:38:13 UTC
RE: Suggestions... (modifying logging messages on the fly)
> Have you tried "%.80m" or similar? That should specify a maximum
> message length of 80 characters. If the message is longer it will be
> truncated from the beginning.
Yes I tried but the "truncated from the beginning" forbideen me from
generating an meaningfull message within 160 chars. BTW with a simple
example I saw that the exceptions goes directly on the trace, so I have
to remove the printStackTrace.
On the book, speaking about writing my own layout I see an example with
a trivial MyLayout and a comment on the ignoresThrowable() method.
I think the only viable solution is writing a custom layout.
Bye
--
Davide
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
RE: Suggestions... (modifying logging messages on the fly)
Posted by Larry Young <ly...@dalmatian.com>.
Davide,
That's exactly what I did. I called mine NewPatternLayout
(imaginative, huh!). It simply a wrapper around the PatternLayout that
tells the appender that it will handle Throwable, and then doesn't.
--- regards ---
Larry
At 03:38 AM 3/1/05, you wrote:
> > Have you tried "%.80m" or similar? That should specify a maximum
> > message length of 80 characters. If the message is longer it will be
> > truncated from the beginning.
>
>Yes I tried but the "truncated from the beginning" forbideen me from
>generating an meaningfull message within 160 chars. BTW with a simple
>example I saw that the exceptions goes directly on the trace, so I have
>to remove the printStackTrace.
>On the book, speaking about writing my own layout I see an example with
>a trivial MyLayout and a comment on the ignoresThrowable() method.
>I think the only viable solution is writing a custom layout.
>
>Bye
>
>--
>Davide
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org
--------------------------
Larry Young
The Dalmatian Group
www.dalmatian.com
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org