Open daniel-res opened 1 year ago
Looking to have a time-stamp on each file created (not just the rotated files). I've experiments with updating the file name formatting, such as
w := zapcore.AddSync(&lumberjack.Logger{ Filename: fmt.Sprintf("%s/dump-%v.log", logPath, time.Now().Format(time.RFC822)), MaxSize: maxSize, MaxBackups: maxBackUp, MaxAge: maxAge, })
but it appears to affect rotated file logging
This maybe a limitation in the way openNew() calls the newname := backupName(name, l.LocalTime) .
openNew()
newname := backupName(name, l.LocalTime)
A better enhancement would be to just accept the log file prefix instead of log file name
Looking to have a time-stamp on each file created (not just the rotated files). I've experiments with updating the file name formatting, such as
but it appears to affect rotated file logging