utils/log: support max days of keeping log files

This commit is contained in:
fatedier
2016-05-03 21:41:57 +08:00
Unverified
parent d7797cbd18
commit c10321ead6
8 changed files with 25 additions and 10 deletions
+6
View File
@@ -32,6 +32,7 @@ var (
LogFile string = "console"
LogWay string = "console" // console or file
LogLevel string = "info"
LogMaxDays int64 = 3
HeartBeatTimeout int64 = 90
UserConnTimeout int64 = 10
@@ -82,6 +83,11 @@ func LoadConf(confFile string) (err error) {
LogLevel = tmpStr
}
tmpStr, ok = conf.Get("common", "log_max_days")
if ok {
LogMaxDays, _ = strconv.ParseInt(tmpStr, 10, 64)
}
// servers
for name, section := range conf {
if name != "common" {