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 "Abramson, Rami" <ra...@terayon.com> on 2003/02/03 14:43:19 UTC
How to truncate characters in the layout of priority
Hello,
How is it possible in the property file to define a layout that outputs only
the first 3 characters of the priority?
Output lines for example,
DEB This is a test of DEBUG...
FAT This is a test of FATAL...
Instead of receiving,
DEBUG This is a test of DEBUG...
FATAL This is a test of FATAL...
if we use:
log4j.appender.dest1.layout.ConversionPattern=%-5p %m%n
thank you,
Rami A.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Re: How to truncate characters in the layout of priority
Posted by Daniel Serodio <da...@checkforte.com.br>.
Use %3p for the first 3 characters of the priority.
[]'s
Daniel Serodio
On Mon, 2003-02-03 at 11:43, Abramson, Rami wrote:
> Hello,
>
> How is it possible in the property file to define a layout that outputs only
> the first 3 characters of the priority?
>
> Output lines for example,
>
> DEB This is a test of DEBUG...
> FAT This is a test of FATAL...
>
> Instead of receiving,
> DEBUG This is a test of DEBUG...
> FATAL This is a test of FATAL...
>
> if we use:
> log4j.appender.dest1.layout.ConversionPattern=%-5p %m%n
>
> thank you,
>
> Rami A.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
--
Daniel Serodio <da...@checkforte.com.br>
CheckForte
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Re: How to truncate characters in the layout of priority
Posted by Michiel Meeuwissen <Mi...@omroep.nl>.
"Abramson, Rami" <ra...@terayon.com> wrote:
> How is it possible in the property file to define a layout that outputs only
> the first 3 characters of the priority?
I had to extend PatternLayout (and PatternParser) for this (defined
%q)... Just a few lines. I can send the code.
Michiel
--
mihxil' Michiel Meeuwissen
Mediapark C101 Hilversum
+31 (0)35 6772979
[]()
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org