Java Mailing List Archive

http://www.java2.5341.com/

Home » Log4J Users List »

RE: How to apply layout to AsyncAppender?

Scott Deboy

2008-07-03

Replies: Find Java Web Hosting

Author LoginPost Reply
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@(protected)

www.comotivsystems.com



-----Original Message-----
From: Robbie Robinson [mailto:RobbieRobinson@(protected)]
Sent: Thu 7/3/2008 10:40 AM
To: log4j-user@(protected)
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@(protected)
For additional commands, e-mail: log4j-user-help@(protected)
©2008 java2.5341.com - Jax Systems, LLC, U.S.A.