Browse Source

fix: log configure format

v1.x.x
dnomd343 2 years ago
parent
commit
245a262636
  1. 18
      cmd/proxy/config.go

18
cmd/proxy/config.go

@ -37,9 +37,11 @@ var outboundsConfig = `{
}` }`
type logObject struct { type logObject struct {
Loglevel string `json:"loglevel"` Log struct {
Access string `json:"access"` Loglevel string `json:"loglevel"`
Error string `json:"error"` Access string `json:"access"`
Error string `json:"error"`
} `json:"log"`
} }
type inboundsObject struct { type inboundsObject struct {
@ -67,11 +69,11 @@ func loadLogConfig(logLevel string, logDir string) string {
log.Warningf("Unknown log level -> %s", logLevel) log.Warningf("Unknown log level -> %s", logLevel)
logLevel = "warning" // using `warning` as default logLevel = "warning" // using `warning` as default
} }
return common.JsonEncode(logObject{ logConfig := logObject{}
Loglevel: logLevel, logConfig.Log.Loglevel = logLevel
Access: logDir + "/access.log", logConfig.Log.Access = logDir + "/access.log"
Error: logDir + "/error.log", logConfig.Log.Error = logDir + "/error.log"
}) return common.JsonEncode(logConfig)
} }
func loadHttpConfig(tag string, port int, sniff sniffObject) interface{} { func loadHttpConfig(tag string, port int, sniff sniffObject) interface{} {

Loading…
Cancel
Save