How to create new log file for each application run

后端 未结 4 967
走了就别回头了
走了就别回头了 2020-12-29 23:55

As the title implies how can I create a new log file for each application run ? I know how to do it for minute/hour/etc. but not for app. run

There is what I have fo

4条回答
  •  滥情空心
    2020-12-30 00:47

    See https://github.com/NLog/NLog/blob/master/tests/NLog.UnitTests/LayoutRenderers/Wrappers/CachedTests.cs for an example of how to use the Cached layout renderer.

    Basically it can be used like this:

    ${cached:${variable}:cached=true}
    

提交回复
热议问题