natefinch / lumberjack

lumberjack is a log rolling package for Go
MIT License
4.81k stars 593 forks source link

Time zone issue with log rotation #198

Open wangkunn opened 10 months ago

wangkunn commented 10 months ago

Hi nate, Thank you for your work in lumberjack!

When I used this library, I encountered the following problem:

When calculating whether an old log file has reached rotation time, the time zone is not taken into account for the processing of timestamps in log file names, even if localtime is set to true. This may cause the log rotation time to differ from MaxAge.

I have submitted a PR to solve this problem, please evaluate whether it can be accepted.

197