How to use Pattern layout with SocketAppender

后端 未结 1 1277
离开以前
离开以前 2020-12-22 00:53

I read org.apache.log4j.net.SocketAppender does not use a Layout. But, I really need to format my logs and I need to use a ConversionPattern. Does anybody know an alternate

1条回答
  •  抹茶落季
    2020-12-22 01:50

    The logs sent through a SocketAppender are serialized and can't have a layout specified to it until it is deserialized. On the remote host you'll have access to all the same information and should be able to specify the layout that the logs are printed in. So the difference is only that you specify the layout on the other side.

    0 讨论(0)
提交回复
热议问题