serilog / serilog-extensions-logging

Serilog provider for Microsoft.Extensions.Logging

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Log file is always in use

HarelM opened this issue · comments

Consider the following scenario:
I want to see a fresh log while testing a production site - meaning I can't shutdown the site for this.
The easiest solution would be to delete the current log file so that all newly logged lines will appear in a new file so I'll have easier time seeing the request I make in order to debug an issue.
Currently I can't delete a log file because it's being used.
Feature suggestion: allow deleting a log file while am asp.core site is running and the newly added log lines will create a new file.

Thanks for the suggestion. I think this would be one for https://github.com/serilog/serilog-sinks-file (this repository's a generic integration library).

It's an interesting scenario, but may be a fairly small benefit vs the risk/effort in changing locking mode code and/or APIs to activate this, plus possibly documentation so that it can be found. It might be a good one to experiment with and raise if there's a simple implementation path - I don't think it's likely to be actively pursued at present because of the bulk of other maintenance work ahead in the queue.

Cheers!
Nick

Thanks for the quick response!
Unfortunately this is the second request I'm bringing and these features are truly needed for my site.
Serilog is probably very good to use when you don't need to be able to configure things, unfortunately I have a bad case of OCD, especially when it comes to logs and I need more power than this library is giving me, so I'm moving to NLog.
Good luck!

No worries! Thanks for the feedback - just might not be a great fit for your preferences right now 👍