When starting my windows service with "NT AUTHORITY\NETWORK SERVICE" credentials I experience a strange issue with NLog: it simply does not log anything to the file target if the filename contains dots.
I'm running windows service on my WinServer 2008 R2 Standard with .NET Framework 3.5 SP1 feature enabled, NLog.config is as follows:
<targets>
<target xsi:type="File"
name="f"
fileName="${basedir}/logs/${shortdate}.txt"
encoding="utf-8"
concurrentWrites="true"
keepFileOpen="false"
layout="${longdate} ${uppercase:${level}} ${message}"/>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="f" />
</rules>
After some googling and experimenting with config I came up with a workaround by not including file extension in fileName
parameter and it worked just fine, which solves the problem but does not look like a decent solution.
And what makes the issue look more like a some weird magic to me is the fact that I managed to solve the problem with log file extension in config of my second windows service (which is running on the same machine with the same credenials) simply by changing assembly information in project options.
Any ideas?