logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Deboy" <sde...@comotivsystems.com>
Subject RE: How to apply layout to AsyncAppender?
Date Thu, 03 Jul 2008 17:41:59 GMT
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
111 SW Columbia Street Ste. 950
Portland, OR  97201

Telephone:      503.224.7496
Cell:           503.997.1367
Fax:            503.222.0185



-----Original Message-----
From: Robbie Robinson [mailto:RobbieRobinson@m2-corp.com]
Sent: Thu 7/3/2008 10:40 AM
To: log4j-user@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.


View raw message