adams85 / filelogger

A lightweight yet feature-rich file logger implementation for the Microsoft.Extensions.Logging framework.
MIT License
147 stars 22 forks source link

Change of month while logging to file does not reset counter #21

Closed Surdna closed 2 years ago

Surdna commented 2 years ago

Hello, While using logger I saw that in case of month change, counter do not reset in new path. In config I've set path to: "Files": [ { "Path": "Logs///.log" } ] and it works great for most of the time but while advancing to next month I get more or less:

Logs/2022/02/000.log
...
Logs/2022/02/005.log
(after date change)
Logs/2022/03/005.log

I'm not sure if it's expected behaviour and I guess I can change it for myself in FileLoggerProcessor.cs->UpdateFilePath but it would be great to confirm that with creators.

Thanks, Surdna

adams85 commented 2 years ago

Hi!

Thanks for the report. This behavior was not by design.

v3.3.0 fixes it.