1234567891011121314151617181920 |
- package utils
- import (
- "github.com/beego/beego/v2/core/logs"
- "os"
- "time"
- )
- var FileLog *logs.BeeLogger
- var BinLog *logs.BeeLogger
- func init() {
- FileLog = logs.NewLogger(1000000)
- FileLog.SetLogger(logs.AdapterFile, `{"filename":"./rdlucklog/hongze_mfyx_gzh.log"}`)
- binLogDir := `./binlog`
- os.MkdirAll(binLogDir, os.ModePerm)
- BinLog = logs.NewLogger(1000000)
- BinLog.SetLogger(logs.AdapterMultiFile, `{"filename":"./binlog/binlog.`+time.Now().Format(FormatDate)+`.log","maxdays":30}`)
- }
|