This project has moved. For the latest updates, please go here.
2
Vote

Source info not shown with NLog >= 4.3.0

description

Hey, it appears that some breaking changes have been introduced in NLog 4.3.0. Since this version of NLog, Sentinel isn't able anymore to extract source info from NLog's packets. Tested with Sentinel 0.12.4.0 and the version from the current develop branch (1.0.0.0).

Target configuration is:
<target name="viewer"
            xsi:type="NLogViewer"
            layout="Log4JXmlEventLayoutRenderer"
            includeSourceInfo="true"
            includeNLogData="true"
            includeNdc="true"
            ndcItemSeparator=";"
            address="udp://127.0.0.1:9999" />

comments

yarseyah wrote Aug 14, 2016 at 12:40 PM

I can confirm your findings, but the defect is in nLog. Since 4.2.3 the source information is not sent. Here is a test capture from 4.2.3:
<log4j:event logger="NLog4Tester.Program" level="ERROR" timestamp="1471178100848" thread="9"><log4j:message>Src:'Foo', Msg:'Unknown issue encountered - 0'</log4j:message><log4j:throwable>System.Collections.Generic.KeyNotFoundException: Some wrapped message ---&gt; System.NotSupportedException: Specified method is not supported.
   --- End of inner exception stack trace ---</log4j:throwable><log4j:NDC /><log4j:throwable><![CDATA[System.Collections.Generic.KeyNotFoundException: Some wrapped message ---> System.NotSupportedException: Specified method is not supported.
   --- End of inner exception stack trace ---]]></log4j:throwable><log4j:locationInfo class="NLog4Tester.Program" method="Void LogMessage(System.String)" file="C:\Users\Ray\Development\sentinel\nLog4Tester\Program.cs" line="73" /><nlog:eventSequenceNumber>1</nlog:eventSequenceNumber><nlog:locationInfo assembly="NLog4Tester, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /><nlog:properties /><log4j:properties><log4j:data name="log4japp" value="NLog4Tester.vshost.exe(12604)" /><log4j:data name="log4jmachinename" value="I7" /></log4j:properties></log4j:event>
and here is one from 4.3.7:
<log4j:event logger="NLog4Tester.Program" level="ERROR" timestamp="1471178347864" thread="9"><log4j:message>UTF-8 test code: ’ ☻ ♠ ♣ ♥ ♦</log4j:message><log4j:throwable>System.Collections.Generic.KeyNotFoundException: Some wrapped message ---&gt; System.NotSupportedException: Specified method is not supported.
   --- End of inner exception stack trace ---</log4j:throwable><log4j:NDC /><log4j:throwable><![CDATA[System.Collections.Generic.KeyNotFoundException: Some wrapped message ---> System.NotSupportedException: Specified method is not supported.
   --- End of inner exception stack trace ---]]></log4j:throwable><log4j:properties><log4j:data name="log4japp" value="NLog4Tester.vshost.exe(2172)" /><log4j:data name="log4jmachinename" value="I7" /></log4j:properties></log4j:event>
The whole log4j:locationInfo element is no longer transferred.

R