-
Notifications
You must be signed in to change notification settings - Fork 33
Sink Is Creating New Log Files Within the Day With "_001" at the end #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi - thanks for the note. Yes, I think you need to grab version 3.0.0 of the sink and specify Cheers! |
I've tried that I'm afraid, and while it may work, I get errors when trying to later read the log file (I have an endpoint in my API that allows me to get the contents of the log file, since the API is hosted out in Azure and I don't have easy access to it): The process cannot access the file because it is being used by another process. I'm using the following code to read the log file:
|
Thanks for the follow-up. Sounds like you need to update the version of the Serilog.Sinks.File that's in use - #20 was fixed recently in https://github.com/serilog/serilog-sinks-file/releases/tag/v3.0.1 but the NuGet package dependency version wasn't update here. Fixing that now. Cheers, |
Hi, Thanks |
Hi @chic2013 - can you please open a fresh ticket with details showing exactly how you're configuring the logger? Thanks! |
Sure |
I've currently got serilog set up in my Web API project to use the rolling file sink. It configures the logs in the Global.asax Application_Start like this:
This works very well; however, there is one issue that I've been seeing... on occasion, it rolls the log file over and appends a "_001", "_002", etc. Is there a way to prevent this from happening? I thought at first that it had to do with the log files getting too big, but it'll sometimes roll them over when there is only a couple lines in there. Do I need to initialize the log file in a different way?
The text was updated successfully, but these errors were encountered: