4
Vote

Add NLog example to the Receivers

description

After a lot of searching I found out that Log2Console needs the Chainsaw Target in NLog, and the TCP/IP one that the receivers dialog shows doesn't work (atleast for ASP.NET apps).

Could you add an NLog example to the UDP receiver example, below the log4net example?

e.g.
<target name="n1" xsi:type="Chainsaw" address="udp://127.0.0.1:7071" />
<logger name="*" minlevel="Info" writeTo="n1" />
Also make sure people know it has to be an IP address, as localhost won't work.

comments

Kiwawa wrote Sep 24, 2013 at 1:51 PM

Me too!

The only combination I got NLog working over network was using Chainsaw (not mentioned in any documentation), using TCP (not sure why UDP barfs), and with IP instead of "localhost", which is very strange since they should be completely equivalent.

wrote Feb 13, 2015 at 7:31 PM

WouterSF wrote Dec 2, 2015 at 10:36 AM

For me it also works fine with the following target:
    <target name="udp" xsi:type="Network" address="udp4://127.0.0.1:7071"
            layout="${log4jxmlevent}" />
What does not work for log2console 1.6 and higher is the exceptions. They won't log into the Exceptions tab.