logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mulert, Bill" <bill.mul...@kroger.com>
Subject How to configure multiple appenders and categories with SocketServer?
Date Tue, 01 Sep 2009 13:56:54 GMT
I have a large application that's currently using about 40 RollingFfileAppenders to log the
actions occurring in various parts of the app. I'd like to transition to using SocketAppender
and SocketServer so my app can be clustered and each member can delegate to the SocketServer
to log events. The log4j.xml used in the application looks like:

                <appender name="exceptionLogFile" class="org.apache.log4j.RollingFileAppender">
                                <param name="File" value=" /logs/exceptions.log"/>
                                <param name="Append" value="true"/>
                                <param name="MaxFileSize" value="1000KB"/>
                                <param name="MaxBackupIndex" value="5"/>
                                <layout class="org.apache.log4j.PatternLayout">
                                                <param name="ConversionPattern" value="%x
%d %-5p - %m%n"/>

                Lots more appenders here. They only vary in name.

                <category additivity="false" name="app.exceptions">
                                <priority value="error"/>
                                <appender-ref ref="exceptionLogFile"/>

                Lots more categories here. Each one specifies a different appender, except
a few that share one.

Can I replace each FileAppender with a SocketAppender all pointed to the same host/port?
Can the SocketServer maintain the association between each category and the FileAppender I
want for it?
What would the lcf file look like for this?

I've done plenty of searching on this topic, and most everything I've seen deals with very
simple cases, but nothing like multiple categories using multiple appenders. Any guidance
would be most appreciated.

-- bill

This e-mail message, including any attachments, is for the sole use of the intended recipient(s)
and may contain information that is confidential and protected by law from unauthorized disclosure.
Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy all copies of the
original message.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message