问题描述
我正在寻找一种使log4net支持zeroconf将日志发布到apache链锯的方法(请参阅此处: log4net是否支持zeroconf?).显然,log4j已经可以使用Zeroconfsockethubappender来执行此操作.
我可以在哪里查看Java Zeroconfsockethubappender的源?我在Apache电锯和Log4J存储库中都看过.
不成功.推荐答案
zeroconf是log4j'companion',但是zeroconfsockethubappender(和该伴侣)不再需要,因为log4j中的大多数基于网络的附录具有Zeroconf支持Zeroconf支持log4j 1.2.2.16.
启用zeroconf所需要做的就是将jmdns.jar添加到您的classPath中,并在appender配置中设置'advertiseViamulticastDns'param'true.
以下是提交和日志信息,描述了改进附录(和接收器)中Zeroconf支持的更改: >
如果您仍然想使用它,这是指向Zeroconf页面的链接 source-repository.html
顺便说一句,电锯的SVN头修订(应尽快发布)包括支持使用广告的zeroconf appender信息自动创建接收器的支持.
问题描述
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.
推荐答案
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.