At 11:00 AM 15/08/2001, Chien Wei Tan wrote:


>Hi,
>
>Would anyone know if it is possible to define different layouts (including
>conversion patterns) for different priorities, (either through the
>configuration file, or in the actual log4j classes), given a specific
>category.
>
>eg. MyApp is a dummy class thats gets an instance of Category, and uses
>DEBUG, INFO, WARN, ERROR, and FATAL. Is is possible to log messages in such
>a way that:
>
>         DEBUG uses PatternLayout, ConversionPattern=%10p (%F:%L) - %m%n
>         INFO  uses SimpleLayout
>         WARN  uses PatternLayout, ConversionPattern=%-4r [%t] %-5p %c %x 
> - %m%n
>         ERROR uses PatternLayout, ConversionPattern=%-5r %8p [%t] %c - %m%n
>         FATAL uses PatternLayout, ConversionPattern=%-5r [%t] %c - %m%n
>
>
>Any help would be greatly appreciated,
>chienwei

This from Ceki yesterday:

>What you can do is to log different priorities to different appenders. You 
>can then attach a different layout (e.g. a PatternLayout) to each 
>appender. Hope this helps, Ceki


Robert



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to