4 Commits

Author SHA1 Message Date
4c129271a5 update at 2019-11-11 10:30:05 by ehlxr 2019-11-11 10:30:05 +08:00
5820e0ded2 update at 2019-11-11 10:28:56 by ehlxr 2019-11-11 10:28:56 +08:00
119fee49af update at 2019-11-11 09:32:36 by ehlxr 2019-11-11 09:32:36 +08:00
a2a63aebee release v0.0.4 2019-11-08 18:18:03 +08:00
3 changed files with 3 additions and 4 deletions

3
go.mod
View File

@@ -3,8 +3,7 @@ module github.com/ehlxr/log
go 1.13
require (
github.com/ehlxr/lumberjack v2.0.0+incompatible
github.com/ehlxr/lumberjack v0.0.1
github.com/robfig/cron/v3 v3.0.0
go.uber.org/zap v1.12.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
)

2
log.go
View File

@@ -242,7 +242,7 @@ func (lc *logConfig) fileWriteSyncer(fileName string) zapcore.WriteSyncer {
}
// Rotating log files daily
runner := cron.New(cron.WithSeconds(), cron.WithLocation(time.UTC))
runner := cron.New(cron.WithSeconds(), cron.WithLocation(time.Local))
_, _ = runner.AddFunc("0 0 0 * * ?", func() {
_ = writer.Rotate(time.Now().AddDate(0, 0, -1))
})

View File

@@ -1 +1 @@
v0.0.4
v0.0.5