blob: a2f5131bd1048e72de23a8fab401583843ca8f9e [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Apache Maven Doxia at 2017-08-02 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Apache Chainsaw &#x2013; </title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20170802" />
<meta http-equiv="Content-Language" content="en" />
</head>
<body class="composite">
<div id="banner">
<a href="http://logging.apache.org/" id="bannerLeft">
<img src="images/ls-logo.jpg" alt="Logging Services" />
</a>
<a href="http://logging.apache.org/log4j" id="bannerRight">
<img src="images/logo.jpg" alt="Apache log4j" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<span id="publishDate">Last Published: 2017-08-02</span>
&nbsp;| <span id="projectVersion">Version: 2.1.0-SNAPSHOT</span>
| <a href="http://www.apache.org/" class="externalLink" title="Apache">Apache</a>
&gt;
<a href="http://logging.apache.org/" class="externalLink" title="Logging Services">Logging Services</a>
&gt;
<a href="http://logging.apache.org:80/chainsaw/" class="externalLink" title="Chainsaw">Chainsaw</a>
&gt;
Apache Chainsaw &#x2013;
</div>
<div class="xright">
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>Get Chainsaw</h5>
<ul>
<li class="none">
<a href="download.html" title="Download">Download</a>
</li>
<li class="none">
<a href="changes-report.html" title="Changes">Changes</a>
</li>
<li class="none">
<a href="http://www.apache.org/licenses/" class="externalLink" title="License">License</a>
</li>
<li class="none">
<a href="distributionnotes.html" title="Important Distribution Notes">Important Distribution Notes</a>
</li>
</ul>
<h5>About Chainsaw</h5>
<ul>
<li class="none">
<a href="index.html" title="Introduction">Introduction</a>
</li>
<li class="none">
<a href="quicktour.html" title="Quick Tour">Quick Tour</a>
</li>
<li class="none">
<strong>Zeroconf</strong>
</li>
<li class="none">
<a href="roadmap.html" title="Roadmap">Roadmap</a>
</li>
<li class="none">
<a href="apidocs/index.html" title="JavaDoc">JavaDoc</a>
</li>
</ul>
<h5>Community</h5>
<ul>
<li class="none">
<a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a>
</li>
<li class="none">
<a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
</li>
</ul>
<h5>Development</h5>
<ul>
<li class="none">
<a href="source-repository.html" title="Repository">Repository</a>
</li>
<li class="none">
<a href="xref/index.html" title="Cross Reference">Cross Reference</a>
</li>
<li class="none">
<a href="dependencies.html" title="Dependencies">Dependencies</a>
</li>
<li class="none">
<a href="cpd.html" title="Duplication">Duplication</a>
</li>
<li class="none">
<a href="pmd.html" title="PMD">PMD</a>
</li>
</ul>
<h5>Apache</h5>
<ul>
<li class="none">
<a href="http://www.apache.org" class="externalLink" title="Home">Home</a>
</li>
<li class="none">
<a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship">Sponsorship</a>
</li>
<li class="none">
<a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks">Thanks</a>
</li>
<li class="none">
<a href="https://www.apache.org/security/" class="externalLink" title="Security">Security</a>
</li>
<li class="none">
<a href="http://www.apachecon.com" class="externalLink" title="Conferences">Conferences</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<!-- Licensed to the Apache Software Foundation (ASF) under one or more --><!-- contributor license agreements. See the NOTICE file distributed with --><!-- this work for additional information regarding copyright ownership. --><!-- The ASF licenses this file to You under the Apache License, Version 2.0 --><!-- (the "License"); you may not use this file except in compliance with --><!-- the License. You may obtain a copy of the License at --><!-- --><!-- http://www.apache.org/licenses/LICENSE-2.0 --><!-- --><!-- Unless required by applicable law or agreed to in writing, software --><!-- distributed under the License is distributed on an "AS IS" BASIS, --><!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --><!-- See the License for the specific language governing permissions and --><!-- limitations under the License. --><div class="section">
<h2><a name="ZeroConf_-_Zero_Configuration"></a>ZeroConf - Zero Configuration</h2>
<p>Apache Chainsaw&#x2122; can use ZeroConf to discover advertised appenders and automatically configure a matching receiver, but you must update your configuration in order to advertise your appender via ZeroConf.</p>
<p>If you are using a newer version of log4j (1.2.16 or greater), most of the network-based appenders are capable of advertising their configurations via ZeroConf, but have this capability disabled by default. To advertise an appender via ZeroConf: [[1]] Download <a class="externalLink" href="http://sourceforge.net/projects/jmdns/">JmDNS</a></p>
<ol style="list-style-type: decimal">
<li>Add the <i>jmdns.jar</i> to your application's classpath</li>
<li>Modify your log4j configuration so that the appender is set to advertise its configuration via ZeroConf (by setting the 'advertiseViaMulticastDNS' parameter to 'true')</li></ol>
<p>Here is a complete log4j.xml file that you can use as a base SocketAppender configuration which advertises the appender via ZeroConf:<i>/p</i></p>
<div class="source">
<pre>&lt;log4j:configuration debug=&quot;false&quot; threshold=&quot;debug&quot; xmlns:log4j=&quot;http://jakarta.apache.org/log4j/&quot;&gt;
&lt;appender name=&quot;socketAppender&quot; class=&quot;org.apache.log4j.net.SocketAppender&quot;&gt;
&lt;param name=&quot;Name&quot; value=&quot;MySockeAppender&quot; /&gt;
&lt;param name=&quot;advertiseViaMulticastDNS&quot; value=&quot;true&quot; /&gt;
&lt;/appender&gt;
&lt;!--ROOT Logger--&gt;
&lt;root&gt;
&lt;level value=&quot;INFO&quot; /&gt;
&lt;appender-ref ref=&quot;socketAppender&quot; /&gt;
&lt;/root&gt;
&lt;/log4j:configuration&gt;</pre></div>
<p>If you are using an older version of log4j (prior to 1.2.16), ZeroConfSocketHubAppender is a ZeroConf-capable appender which is backward compatible with the prior versions of SocketHubAppender and can advertise the appender configuration via ZeroConf:<i>/p</i> [[1]] Download <a class="externalLink" href="http://sourceforge.net/projects/jmdns/">JmDNS</a></p>
<ol style="list-style-type: decimal">
<li>Add the <i>i</i>jmdns.jar<i>/i</i> to your application's classpath</li>
<li>Download <a class="externalLink" href="http://logging.apache.org/log4j/docs/webstart/chainsaw/log4j-zeroconf.zip">log4j ZeroConf extension (provides ZeroConfSocketHubAppender)</a></li>
<li>Add the <i>log4j-zeroconf.jar</i> to your application's classpath</li></ol>
<p>Here is a complete log4j.xml file that you can use as a base ZeroConfSocketAppender configuration which advertises the appender via ZeroConf:<i>/p</i></p>
<div class="source">
<pre>&lt;log4j:configuration debug=&quot;false&quot; threshold=&quot;debug&quot; xmlns:log4j=&quot;http://jakarta.apache.org/log4j/&quot;&gt;
&lt;appender name=&quot;zeroconf&quot; class=&quot;org.apache.log4j.net.ZeroConfSocketHubAppender&quot;&gt;
&lt;param name=&quot;Name&quot; value=&quot;MyZeroConfSockeHubAppender&quot; /&gt;
&lt;/appender&gt;
&lt;!--ROOT Logger--&gt;
&lt;root&gt;
&lt;level value=&quot;INFO&quot; /&gt;
&lt;appender-ref ref=&quot;zeroconf&quot; /&gt;
&lt;/root&gt;
&lt;/log4j:configuration&gt;</pre></div>
<p>Once you have enabled ZeroConf in your log4j configuration and started your application, you should be able to click on the Zeroconf tab inside Chainsaw and see the advertised appenders listed. If you double click on a row, Chainsaw will automatically connect to your application and start receiving events. You can tick the 'auto-connect' option to have Chainsaw immediately connect as soon as it sees your application started. Great for Dev/QA environment.<i>/p</i></p></div>
<div class="section">
<h2><a name="Firewalls_Multicast_protocols_generally_dont_pass_through_firewall_so_in_a_production_environment_Zeroconf_wont_work.p"></a>Firewalls Multicast protocols generally don't pass through firewall, so in a production environment Zeroconf won't work.<i>/p</i></h2></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div>
<div class="center">Copyright &#169; 2002-2017
<a href="http://www.apache.org">Apache Software Foundation</a>.
Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache Software License, Version 2.0</a>.</div><br />
<div class="center">Apache Logging, Apache Log4j, Log4j, Apache Chainsaw, Chainsaw, Apache, the Apache feather logo, the Apache Logging project logo,
and the Apache Log4j logo are trademarks of The Apache Software Foundation.</div>
</div>
</div>
</body>
</html>