Chien Wei,

One other thing to mention that I observed when doing
this is that if you use an AsyncAppender the performance
is greatly improved.  I went from ~375 milliseconds to
~85 milliseconds when I switched to use an AsyncAppender.
This was with a simple test to log 100 events to the
console.

Keith

> -----Original Message-----
> From: Keith Schomburg [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 15, 2001 10:55 AM
> To: LOG4J Users Mailing List
> Subject: RE: Assigning Layouts to Priorities
>
>
> Chien Wei,
>
> I was working on trying to do the very thing you were.
> Attached is a xml configuration file that I used to
> do what your asking.  You will need to use the
> DOMConfigurator class to do this.
>
> Hope this helps.
>
> Keith
>
> > -----Original Message-----
> > From: Chien Wei Tan [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, August 15, 2001 2:11 AM
> > To: LOG4J Users Mailing List; [EMAIL PROTECTED]
> > Subject: RE: Assigning Layouts to Priorities
> >
> >
> >
> > hi rob,
> >
> > thanks... i understand how to log different priorities to different
> > appenders... but i m actually after logging different layouts
> to different
> > priorities... any ideas?
> >
> > cheers,
> > chienwei
> >
> > -----Original Message-----
> > From: Robert Leftwich [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, 15 August 2001 9:19 AM
> > To: LOG4J Users Mailing List
> > Subject: Re: Assigning Layouts to Priorities
> >
> >
> > 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]
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>


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

Reply via email to