Quantcast
Channel: NLog - Advanced .NET Logging
Viewing all articles
Browse latest Browse all 60

Closed Issue: Problem using the log4jxmlevent layout [2705]

$
0
0
<p>Reported in the forum at post: http://nlog-project.org/forum.html#nabble-tc1685658|a1685658</p>
<p>&nbsp;</p>
<p>Hi All,</p>
<p>&nbsp;</p>
<p>I&#39;m using the log4jxmlevent layout on a file target. And I&#39;ve set the includeSourceInfo=true.</p>
<p>&nbsp;</p>
<p>The output that I&#39;m getting in the log file is missing some data. NLog does not close the log4j:event xml tag.</p>
<p>&nbsp;</p>
<p>I&#39;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>&nbsp;</p>
<p>I managed to set a breakpoint in Append() method at line 194 and it seems that it&#39;s looking for UserStackTrace in logEvent which returns null.</p>
<p>&nbsp;</p>
<p>Hope this helps to solve the problem.</p>
<p>&nbsp;</p>
<p>Dan</p>

Comments:

Moved to https://github.com/NLog/NLog/issues/146


Viewing all articles
Browse latest Browse all 60

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>