Skip to content

Commit

Permalink
Fixed log maxage logRotate*60*logRotateTime is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
kazeburo committed Apr 20, 2020
1 parent bff7525 commit 3406765
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion accesslog/accesslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func logWriter(logDir string, logRotate int64, logRotateTime int64) (io.Writer,
rl, err := rotatelogs.New(
logFile,
rotatelogs.WithLinkName(linkName),
rotatelogs.WithMaxAge(time.Duration(logRotate)*86400*time.Second),
rotatelogs.WithMaxAge(time.Duration(logRotate*60*logRotateTime)*time.Second),
rotatelogs.WithRotationTime(time.Second*time.Duration(logRotateTime)*60),
)
if err != nil {
Expand Down

0 comments on commit 3406765

Please sign in to comment.