mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-31 09:57:17 +02:00
envoy: ensure command line args reflect the current log level (#779)
This commit is contained in:
parent
e8f539e69e
commit
aba549a70f
1 changed files with 8 additions and 1 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue