Where can I find the source code for log4j's ZeroConfSocketHubAppender?

血红的双手。 提交于 2019-12-13 02:38:56

问题


I'm looking for a way to make log4net support zeroconf to publish logs to Apache Chainsaw (see here: Does log4net support zeroconf?). Apparently log4j can already do this using a ZeroConfSocketHubAppender.

Where might I be able to view the source for the java ZeroConfSocketHubAppender? I've looked both in the Apache Chainsaw and in the Log4j repositories but was unsuccessful.


回答1:


ZeroConf is a log4j 'companion', but ZeroConfSocketHubAppender (and this companion) is no longer necessary due to the fact that most network-based appenders in log4j have ZeroConf support built-in as of log4j 1.2.16.

All you need to do to enable ZeroConf is add jmdns.jar to your classpath and set the 'advertiseViaMulticastDNS' param to 'true' in the appender configuration.

Here's the commit & log info describing the changes which improved ZeroConf support in the appenders (and receivers): http://svn.apache.org/viewvc?view=revision&revision=924176

Here is a link to the ZeroConf page if you still want to use that http://logging.apache.org/log4j/companions/zeroconf/source-repository.html

By the way, the svn HEAD revision of Chainsaw (which should be released soon) includes support for using the advertised ZeroConf appender information to automatically create receivers.



来源:https://stackoverflow.com/questions/2850611/where-can-i-find-the-source-code-for-log4js-zeroconfsockethubappender

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