mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-19 04:50:02 +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"
|
filename := config.GetFilePath() + suffix + ".log"
|
||||||
|
|
||||||
return NewRotatingFile(filename, func(f *RotatingFile) {
|
return NewRotatingFile(filename,
|
||||||
f.maxAge = config.MaxTime
|
WithMaxAge(config.MaxTime),
|
||||||
f.maxSize = int64(config.MaxFileSize)
|
WithMaxSize(int64(config.MaxFileSize)),
|
||||||
})
|
WithTimestampFormat(config.FileTimestampFormat),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *RotatingFile) newFilename(name string) string {
|
func (w *RotatingFile) newFilename(name string) string {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue