Browse Source

修改读取日志配置的方法

pull/443/head
zhangxin 3 years ago
parent
commit
331086663f
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      infra/logger/config.go

+ 6
- 1
infra/logger/config.go View File

@ -1,6 +1,7 @@
package logger
import (
"LAPP_GAAS_GFrame_BACKEND/utils"
"errors"
"github.com/spf13/viper"
)
@ -48,9 +49,13 @@ type outputSettings struct {
func InitConfig() error {
var err error
baseDir, err := utils.GetCurrentPath("conf")
if err != nil {
return err
}
viper.SetConfigName("log_config")
viper.SetConfigType("yaml")
viper.AddConfigPath("./conf/")
viper.AddConfigPath(baseDir)
if err = viper.ReadInConfig(); err != nil {
return err
}


Loading…
Cancel
Save