socket appenders - basic example step by step [closed]

大兔子大兔子 提交于 2019-12-05 10:55:08
Brian Agnew

This one looks simple and straightforward. From the article:

Example server startup with SimpleSocketServer (from the command line):

> java -jar log4j.jar org.apache.log4j.net.SimpleSocketServer 4712 log4j-server.properties

Now all you have to do is specify your appender on the client.

Example appender:

> log4j.appender.SERVER=org.apache.log4j.net.SocketAppender
> log4j.appender.SERVER.Port=4712
> log4j.appender.SERVER.RemoteHost=loghost
> log4j.appender.SERVER.ReconnectionDelay=10000
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!