[logback-user] Use multiple receivers to log multiple remote server appenders

Chris Hamilton chamilton-dev at compucafe.com
Mon Jul 15 17:05:58 CEST 2013

I have multiple web servers configured in a cluster. I have set up a "server" appender on each instance of the application. 

I have used the Receiver example to create a program that will connect to the remote server appenders and log the messages received from each cluster member to a single remote file.

The problem I have is identifying the source server in the remote remote log file.

What I'm looking for is a way to identify the source server of each message. I have enhanced the SocketReceiver and added a field called ReceiverAlias which is set in logback.xml. Currently I am prepending this string to the log message. This works but doesn't look or feel right. I'm thinking that there ought to be a better way.

Is there an established pattern for this use case?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130715/9a690a6b/attachment.html>

More information about the Logback-user mailing list