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:
parent
d6a7bcd2bb
commit
aa43fc003f
1 changed files with 5 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue