serilog-sinks-file
serilog-sinks-file copied to clipboard
How do I create a new file everytime my app is started?
Hi I want to use rolling files with interval per day. But also If the app has to be restarted, it should create a new log file. Is this possible? Also, is it possible to get the file name after the logger has started?
Hi, thanks for your message.
Not sure about the first question, may be one for Stack Overflow as it's likely someone's had this need in the past, nothing I can think of here, though.
For your second question, I believe https://github.com/serilog/serilog-sinks-file/issues/129 is an existing discussion.
Creating a new log file every launch is useful in client applications, practical examples such as Minecraft
@2A5F to create a new file every time the app is started, you can e.g. generate a filename using a GUID. This issue is about combining file-per-launch with another rolling policy (such as per day). HTH!
@nblumhardt how archive/rolling previous log files using guid?
Minecraft is archived like this
I think it's per day
Closing as stale - ideally questions lke this would be logged on stack overflow - anyone that has the time and interest to follow this repo providing help will also monitor the stack overflow serilog
tag (and many more people will see it and/or answer there as the audience is so much broader)