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 bruce1 <br...@jpmorgan.com> on 2008/09/15 18:47:38 UTC

Ignoring a ConversionPattern for one class

Hi
I have what i would think is a very standard looking log4j config. 

log4j.rootCategory=INFO, A1
log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.File=engine.log
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %l - %m%n

...

...

I want to do is ignore the ConversionPattern for just one class in my
application i.e for that one class my output would look like a
System.out.println call. I can't use System.out.println since the order of
entries in my log is important to me, and the use of an async appender may
render that ordering unreliable.

So i wrote a class that extends PatternLayout and overrides the format
method to just return the string message if the logger class is the one in
question. This works, but anyone know a neater way?

many thanks
-- 
View this message in context: http://www.nabble.com/Ignoring-a-ConversionPattern-for-one-class-tp19496810p19496810.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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