1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 13:30:56 +00:00

fix to advice in #2187

Clear BConfig.Log.Outputs's default "console" while user has set "LogOutputs" in config file.
This commit is contained in:
Back 2016-09-28 16:20:41 +08:00 committed by GitHub
parent bba04dd864
commit 836be7ab9a

View File

@ -294,6 +294,10 @@ func assignConfig(ac config.Configer) error {
} }
if lo := ac.String("LogOutputs"); lo != "" { if lo := ac.String("LogOutputs"); lo != "" {
// if lo is not nil or empty
// means user has set his own LogOutputs
// clear the default setting to BConfig.Log.Outputs
BConfig.Log.Outputs = make(map[string]string)
los := strings.Split(lo, ";") los := strings.Split(lo, ";")
for _, v := range los { for _, v := range los {
if logType2Config := strings.SplitN(v, ",", 2); len(logType2Config) == 2 { if logType2Config := strings.SplitN(v, ",", 2); len(logType2Config) == 2 {