Hello,
So, I have nlog 4.4.8 installed, and I am using this target in my app.config:
<target name="logFile" xsi:type="File" fileName="${logDirectory}/log.xml" archiveFileName="${logDirectory}/log.${shortdate}.{#####}.xml" archiveNumbering="Sequence" archiveEvery="Day" archiveAboveSize="10240000" keepFileOpen="false" maxArchiveFiles="1000">
<layout xsi:type="Log4JXmlEventLayout" />
</target>
What happens (with the 4.4.8 release, with an older one it worked fine) is that this element ends up somehow in the XML, and is becomes invalid, and YALV! cannot load it:
<nlog:properties />
Not sure if this is important or not, but I also have a <log4j:properties> element, and this one is valid.
Thank you
Breaking change was introduced with #2017. The workaround is to specify the layoutrenderer directly:
<target name="logFile" xsi:type="File" fileName="${logDirectory}/log.xml" archiveFileName="${logDirectory}/log.${shortdate}.{#####}.xml" archiveNumbering="Sequence" archiveEvery="Day" archiveAboveSize="10240000" keepFileOpen="false" maxArchiveFiles="1000" layout="${log4jxmlevent:includeNLogData=false}">
Will make a new PR to fix this regression.
NLog 4.4.9 is in the deploy pipeline! Will be online in an hour!
I can confirm that this is working with Yet Another Log4Net Viewer:
<targets>
<target name="logFile" xsi:type="File" fileName="${basedir}/Logs/${shortdate}.xml"
archiveFileName="${basedir}/Logs/log.${shortdate}.{#####}.xml" archiveNumbering="Sequence"
archiveEvery="Day" archiveAboveSize="10240000" keepFileOpen="false" maxArchiveFiles="1000"
layout="${log4jxmlevent:includeNLogData=false}"></target>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="logFile" />
</rules>
My slightly changed version will save the files in the {ApplicationDirectory}/Logs
Most helpful comment
NLog 4.4.9 is in the deploy pipeline! Will be online in an hour!