Scott Deboy | 3 Jul 19:41

RE: How to apply layout to AsyncAppender?

SocketAppender doesn't support a layout. 

log4j doesn't support the concept of inherited layouts, so you'll have to specify it for each appender that
needs one.

Scott Deboy
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR  97201

Telephone:      503.224.7496
Cell:           503.997.1367
Fax:            503.222.0185

sdeboy <at> comotivsystems.com

www.comotivsystems.com

-----Original Message-----
From: Robbie Robinson [mailto:RobbieRobinson <at> m2-corp.com]
Sent: Thu 7/3/2008 10:40 AM
To: log4j-user <at> logging.apache.org
Subject: How to apply layout to AsyncAppender?

I have a scenario where I want to use multiple appenders for the same logger (FileAppender and
SocketAppender for now).  Both appenders need to format the message using the same layout.  Instead of
formatting the single message multiple times(in the FileAppender and in the SocketAppender), I was
wanting to put both of these appenders under an AsyncAppender and apply the layout once in the
AsyncAppender, then send the formatted message to my sub-appenders.  What is the best way to accomplish
this?  From what I can tell the AsyncAppender does not support layouts.

Thanks,
Robbie

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

Gmane