adds log level conf to proxyd (#3704)
This commit is contained in:
parent
53a58bcdc8
commit
24a3668bc8
@ -37,6 +37,21 @@ func main() {
|
|||||||
log.Crit("error reading config file", "err", err)
|
log.Crit("error reading config file", "err", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update log level from config
|
||||||
|
logLevel, err := log.LvlFromString(config.Server.LogLevel)
|
||||||
|
if err != nil {
|
||||||
|
logLevel = log.LvlInfo
|
||||||
|
if config.Server.LogLevel != "" {
|
||||||
|
log.Warn("invalid server.log_level set: " + config.Server.LogLevel)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.Root().SetHandler(
|
||||||
|
log.LvlFilterHandler(
|
||||||
|
logLevel,
|
||||||
|
log.StreamHandler(os.Stdout, log.JSONFormat()),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
shutdown, err := proxyd.Start(config)
|
shutdown, err := proxyd.Start(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Crit("error starting proxyd", "err", err)
|
log.Crit("error starting proxyd", "err", err)
|
||||||
|
@ -14,6 +14,7 @@ type ServerConfig struct {
|
|||||||
WSPort int `toml:"ws_port"`
|
WSPort int `toml:"ws_port"`
|
||||||
MaxBodySizeBytes int64 `toml:"max_body_size_bytes"`
|
MaxBodySizeBytes int64 `toml:"max_body_size_bytes"`
|
||||||
MaxConcurrentRPCs int64 `toml:"max_concurrent_rpcs"`
|
MaxConcurrentRPCs int64 `toml:"max_concurrent_rpcs"`
|
||||||
|
LogLevel string `toml:"log_level"`
|
||||||
|
|
||||||
// TimeoutSeconds specifies the maximum time spent serving an HTTP request. Note that isn't used for websocket connections
|
// TimeoutSeconds specifies the maximum time spent serving an HTTP request. Note that isn't used for websocket connections
|
||||||
TimeoutSeconds int `toml:"timeout_seconds"`
|
TimeoutSeconds int `toml:"timeout_seconds"`
|
||||||
|
@ -19,6 +19,8 @@ ws_port = 8085
|
|||||||
# Maximum client body size, in bytes, that the server will accept.
|
# Maximum client body size, in bytes, that the server will accept.
|
||||||
max_body_size_bytes = 10485760
|
max_body_size_bytes = 10485760
|
||||||
max_concurrent_rpcs = 1000
|
max_concurrent_rpcs = 1000
|
||||||
|
# Server log level
|
||||||
|
log_level = "info"
|
||||||
|
|
||||||
[redis]
|
[redis]
|
||||||
# URL to a Redis instance.
|
# URL to a Redis instance.
|
||||||
|
Loading…
Reference in New Issue
Block a user