Actually I was searching for a while in your documentation and I couldn't see anywhere the answer to my question.
I got a console program in .net core 3.0. (Anyway because the case can be reproduced in Framework too).
The logger will create a new file every different second you want to log something.
I got this config :
<targets>
<target
name="logfile"
xsi:type="File"
fileName="${basedir}/Logs/Log_${date:format=yyyyMMddHH\:mm\:ss}.log"
keepFileOpen="true"
layout="${date:format=dddd dd MMMM yyyy HH\:mm\:ss:culture=Fr} - ${message}"/>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="logfile" />
</rules>
Example :
Program start at 10h00m00s : wants to log "start" then Log_2019101810_00_00.log is created.
Program end at 10h00m10s: wants to log "end" then Log_2019101810_00_10.log is created.
What I want is to use the same file during all program.
Is there any attribute to indicate what I want ?
Thanks
Hi! Thanks for opening your first issue here! Please make sure to follow the issue template - so we could help you better!
You could use https://github.com/NLog/NLog/wiki/Cached-Layout-Renderer for that. See also the last example on that page :)
That is exactly what I was looking for.
Thanks a lot !
Most helpful comment
You could use https://github.com/NLog/NLog/wiki/Cached-Layout-Renderer for that. See also the last example on that page :)