natefinch / lumberjack

lumberjack is a log rolling package for Go
MIT License
4.79k stars 591 forks source link

make the timeformat configurable #107

Closed wenxuwan closed 4 years ago

wenxuwan commented 4 years ago

Hi

i want to configure the timeformat for backup file. if it's ok, i will add ut for this case.

br

wenxuwan

natefinch commented 4 years ago

So, the problem with formatting the backup filename yourself is that you have to be careful to use enough precision so that you don't risk collisions. If you rotate twice in the same day, hour, minute, second, etc.

Really, the backups are just... backups. You shouldn't care what their name is.

wenxuwan commented 4 years ago

So, the problem with formatting the backup filename yourself is that you have to be careful to use enough precision so that you don't risk collisions. If you rotate twice in the same day, hour, minute, second, etc.

Really, the backups are just... backups. You shouldn't care what their name is.

What I think is that users can specify their own log name format, and then they can perform their own operations on the logs in the directory, such as asynchronous collection. But like you said the backups are just... backups, so let's close the pr. Thanks for your comments.