<p>Reported in the forum at post: http://nlog-project.org/forum.html#nabble-tc1685658|a1685658</p>
<p> </p>
<p>Hi All,</p>
<p> </p>
<p>I'm using the log4jxmlevent layout on a file target. And I've set the includeSourceInfo=true.</p>
<p> </p>
<p>The output that I'm getting in the log file is missing some data. NLog does not close the log4j:event xml tag.</p>
<p> </p>
<p>I've set the nlog throwExceptions and the internalLogFile and I get an exception:</p>
<p>Warn Exception in NLog.LayoutRenderers.Log4JXmlEventLayoutRenderer.Append(): System.NullReferenceException: Object reference not set to an iinstance of an object.</p>
<p>at NLog.LayoutRenderers.Log4JXmlEventLayoutRenderer.Append(StringBuilder builder, LogEventInfo logEvent) in E:\My Programs\NLog\NLog\src\LayoutRenderers\Log4JXmlEvent.cs:line 194</p>
<p>at NLog.Layout.GetFormattedMessage(LogEventInfo logEvent) in E:\My Programs\NLog\NLog\src\NLog\Layout.cs:line 142</p>
<p> </p>
<p>I managed to set a breakpoint in Append() method at line 194 and it seems that it's looking for UserStackTrace in logEvent which returns null.</p>
<p> </p>
<p>Hope this helps to solve the problem.</p>
<p> </p>
<p>Dan</p>
Comments:
<p> </p>
<p>Hi All,</p>
<p> </p>
<p>I'm using the log4jxmlevent layout on a file target. And I've set the includeSourceInfo=true.</p>
<p> </p>
<p>The output that I'm getting in the log file is missing some data. NLog does not close the log4j:event xml tag.</p>
<p> </p>
<p>I've set the nlog throwExceptions and the internalLogFile and I get an exception:</p>
<p>Warn Exception in NLog.LayoutRenderers.Log4JXmlEventLayoutRenderer.Append(): System.NullReferenceException: Object reference not set to an iinstance of an object.</p>
<p>at NLog.LayoutRenderers.Log4JXmlEventLayoutRenderer.Append(StringBuilder builder, LogEventInfo logEvent) in E:\My Programs\NLog\NLog\src\LayoutRenderers\Log4JXmlEvent.cs:line 194</p>
<p>at NLog.Layout.GetFormattedMessage(LogEventInfo logEvent) in E:\My Programs\NLog\NLog\src\NLog\Layout.cs:line 142</p>
<p> </p>
<p>I managed to set a breakpoint in Append() method at line 194 and it seems that it's looking for UserStackTrace in logEvent which returns null.</p>
<p> </p>
<p>Hope this helps to solve the problem.</p>
<p> </p>
<p>Dan</p>
Comments:
Moved to https://github.com/NLog/NLog/issues/146