I am trying to seperate my log files with NLog.
<target name="logfile" xsi:type="File" fileName="c:\tmp\log\app.${shortdate}.log" layout="${longdate} ${uppercase:${level}} ${message}">
</target>
<target name="hangfirelog" xsi:type="File" fileName="c:\tmp\log\HangFire.${shortdate}.log" layout="${longdate} ${uppercase:${level}} ${message}">
</target>
<logger name="HangFire.*" minlevel="Debug" writeTo="hangfirelog" />
<logger name="MyAppNamespace.*" minlevel="Debug" writeTo="logfile" />
Hangfire does not log into the “hangfirelog” File
If I log everything in one file, everything works fine.
<logger name="*" minlevel="Debug" writeTo="logfile" />
I guess Hangfire didn’t read the “rules” Section in the NLog.config
File