Commit 713f2881 authored by felipe's avatar felipe Committed by GitHub

fix(proxyd): log initialization (#9785)

* fix(proxyd): log initialization

* update integration test as well
parent f1db7939
......@@ -28,7 +28,7 @@ var (
func main() {
// Set up logger with a default INFO level in case we fail to parse flags.
// Otherwise the final critical log won't show what the parsing error was.
slog.SetDefault(slog.New(slog.NewJSONHandler(
log.SetDefault(log.NewLogger(slog.NewJSONHandler(
os.Stdout, &slog.HandlerOptions{Level: slog.LevelInfo})))
log.Info("starting proxyd", "version", GitVersion, "commit", GitCommit, "date", GitDate)
......@@ -50,7 +50,7 @@ func main() {
log.Warn("invalid server.log_level set: " + config.Server.LogLevel)
}
}
slog.SetDefault(slog.New(slog.NewJSONHandler(
log.SetDefault(log.NewLogger(slog.NewJSONHandler(
os.Stdout, &slog.HandlerOptions{Level: logLevel})))
if config.Server.EnablePprof {
......
......@@ -186,6 +186,6 @@ func (h *ProxydWSClient) WriteControlMessage(msgType int, msg []byte) error {
}
func InitLogger() {
slog.SetDefault(slog.New(
log.NewTerminalHandlerWithLevel(os.Stdout, slog.LevelDebug, false)))
log.SetDefault(log.NewLogger(slog.NewJSONHandler(
os.Stdout, &slog.HandlerOptions{Level: slog.LevelDebug})))
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment