Browse Source

fix: log configure format

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

12
cmd/proxy/config.go

@ -37,9 +37,11 @@ var outboundsConfig = `{
}` }`
type logObject struct { type logObject struct {
Log struct {
Loglevel string `json:"loglevel"` Loglevel string `json:"loglevel"`
Access string `json:"access"` Access string `json:"access"`
Error string `json:"error"` 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