socket appenders - basic example step by step [closed]

喜你入骨 提交于 2019-12-07 06:18:23

问题


Could you recommend simple tutorial about using log4j in distributed system, especially about SocketAppender?

I tried to find some basic examples, but I failed.


回答1:


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


来源:https://stackoverflow.com/questions/11756148/socket-appenders-basic-example-step-by-step

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!