diff --git a/internal/envoy/envoy.go b/internal/envoy/envoy.go index 6941de91b..8d62d7cb3 100644 --- a/internal/envoy/envoy.go +++ b/internal/envoy/envoy.go @@ -43,6 +43,7 @@ type Server struct { grpcPort, httpPort string opts *config.Options + logLevel string } // NewServer creates a new server with traffic routed by envoy. @@ -60,6 +61,12 @@ func NewServer(opts *config.Options, grpcPort, httpPort string) (*Server, error) opts: opts, } + if srv.opts.ProxyLogLevel != "" { + srv.logLevel = srv.opts.ProxyLogLevel + } else { + srv.logLevel = srv.opts.LogLevel + } + err = srv.writeConfig() if err != nil { return nil, fmt.Errorf("error writing initial envoy configuration: %w", err) @@ -78,7 +85,7 @@ func (srv *Server) Run(ctx context.Context) error { srv.cmd = exec.CommandContext(ctx, envoyPath, "-c", configFileName, - "--log-level", log.Logger.GetLevel().String(), + "--log-level", srv.logLevel, "--log-format", "[LOG_FORMAT]%l--%n--%v", "--log-format-escaped", "--disable-hot-restart",