1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

internal/log/RotatingFile.go: in NewRotatingFileFromConfig() set timestamp format.

This commit is contained in:
Henrik Hautakoski 2024-02-22 10:08:50 +01:00
parent d6a7bcd2bb
commit aa43fc003f

View file

@ -61,10 +61,11 @@ func NewRotatingFileFromConfig(config Config, suffix string) (*RotatingFile, err
filename := config.GetFilePath() + suffix + ".log"
return NewRotatingFile(filename, func(f *RotatingFile) {
f.maxAge = config.MaxTime
f.maxSize = int64(config.MaxFileSize)
})
return NewRotatingFile(filename,
WithMaxAge(config.MaxTime),
WithMaxSize(int64(config.MaxFileSize)),
WithTimestampFormat(config.FileTimestampFormat),
)
}
func (w *RotatingFile) newFilename(name string) string {