Skip to content

Commit

Permalink
eventlog: buffer writes before pushing them to lumberjack - same effe…
Browse files Browse the repository at this point in the history
…ct, no upstream changes. Thx @natefinch!
  • Loading branch information
cryptix committed Apr 30, 2015
1 parent eacaa2d commit 5c0403c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions thirdparty/eventlog/option.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package eventlog

import (
"bufio"
"io"
"os"

Expand Down Expand Up @@ -53,12 +54,12 @@ func Output(w io.Writer) Option {
func OutputRotatingLogFile(config LogRotatorConfig) Option {
return func() {
logrus.SetOutput(
&lumberjack.Logger{
bufio.NewWriter(&lumberjack.Logger{
Filename: config.Filename,
MaxSize: int(config.MaxSizeMB),
MaxBackups: int(config.MaxBackups),
MaxAge: int(config.MaxAgeDays),
})
}))
}
}

Expand Down

0 comments on commit 5c0403c

Please sign in to comment.