log4net and ChainSaw

  • Thread starter Thread starter Günther Schabus
  • Start date Start date
G

Günther Schabus

Hello all,

does anyone use log4net and ChainSaw or LumberMill for viewing
the logs?

If so, can someone give me a hint for configuring log4net and
Chainsaw. I've read something mystic about UDPAppender, but
haven't seen any working configuration.

Thank you in advance.
Günther
 
I was able to get Chainsaw v2 to work with log4net UDPAppender but only on
my local machine.

I set up my Chainsaw file to look like this:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="true">
<plugin name="UDPReceiver" class="org.apache.log4j.net.UDPReceiver">
<param name="Port" value="8080" />
</plugin>
</log4j:configuration>

Save this in an XML file and use it when you startup Chainsaw, will prompt
for receiver setup, nav to this file.

In your log4net.config, add this appender:
<appender name="UdpAppender" type="log4net.Appender.UdpAppender">
<localPort value="80" />
<remoteAddress value="127.0.0.1" />
<remotePort value="8080" />
<layout type="log4net.Layout.XmlLayoutSchemaLog4j">
<locationInfo value="true" />
</layout>
</appender>

Chainsaw should now be able to receive UDP locally (using loopback here).
I have been unable to get it to work from a remote machine as of yet but am
still trying.

c
 
Back
Top