=changed path from log
This commit is contained in:
parent
9b8d325761
commit
a9a06fd142
|
@ -2,7 +2,7 @@ package rotater
|
|||
|
||||
import (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"log"
|
||||
"amuz.es/src/infra/goutils/logger"
|
||||
"github.com/lestrrat-go/file-rotatelogs"
|
||||
|
@ -19,11 +19,12 @@ func NewLogWriter(FileName string, logDir string, options ...Option) (logger.Rot
|
|||
default:
|
||||
logpath := FileName
|
||||
if logDir != "" {
|
||||
logpath = path.Join(logDir, FileName)
|
||||
logpath = filepath.Join(logDir, FileName)
|
||||
}
|
||||
logpath,_ = filepath.Abs(logpath)
|
||||
log.Println(" Attention!! log writes to ", logpath)
|
||||
options=append(options,rotatelogs.WithLinkName(logpath))
|
||||
if logWriter, err := NewRotater(logpath+".%Y%M%D", options...); err != nil {
|
||||
if logWriter, err := NewRotater(logpath+".%Y%m%d", options...); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
loggers.Store(logWriter)
|
||||
|
|
Reference in New Issue