| | |
| | | import ( |
| | | |
| | | "flag" |
| | | "github.com/spf13/viper" |
| | | "sync" |
| | | "net/http" |
| | | _ "net/http/pprof" |
| | | "plugin" |
| | | |
| | | //"github.com/spf13/viper" |
| | | logger "github.com/alecthomas/log4go" |
| | | //"basic.com/valib/logger.git" |
| | | "basic.com/valib/logger.git" |
| | | "github.com/panjf2000/ants/v2" |
| | | |
| | | "basic.com/pubsub/protomsg.git" |
| | |
| | | // 日志初始化 |
| | | |
| | | insertdata.Init(*env) |
| | | //var logFile = "./logger/" |
| | | //if viper.GetString("LogBasePath") != "" { |
| | | // logFile = viper.GetString("LogBasePath") |
| | | //} |
| | | var logFile = "./logger/" |
| | | if viper.GetString("LogBasePath") != "" { |
| | | logFile = viper.GetString("LogBasePath") |
| | | } |
| | | //logFile = logFile + "ruleprocess.log" |
| | | //fmt.Println("日志地址:",logFile) |
| | | //logger.Config(logFile, logger.DebugLevel) |
| | | logger.Config(logFile, logger.DebugLevel) |
| | | //logger.SetSaveDays(7) |
| | | // log4go |
| | | logger.LoadConfiguration("./logger/log.xml") |
| | | //logger.LoadConfiguration("./logger/log.xml") |
| | | logger.Info("日志初始化成功!") |
| | | |
| | | } |