utils/log: support max days of keeping log files

This commit is contained in:
fatedier
2016-05-03 21:41:57 +08:00
parent d7797cbd18
commit c10321ead6
8 changed files with 25 additions and 10 deletions

View File

@@ -28,6 +28,7 @@ var (
LogFile string = "console"
LogWay string = "console"
LogLevel string = "info"
LogMaxDays int64 = 3
HeartBeatInterval int64 = 20
HeartBeatTimeout int64 = 90
)
@@ -69,6 +70,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)
}
var authToken string
tmpStr, ok = conf.Get("common", "auth_token")
if ok {