Skip to content

Commit

Permalink
e2e: do not log http in api module while in debug mode
Browse files Browse the repository at this point in the history
API servers receive healthcheck requests which pollutes the logs.
  • Loading branch information
Choraden committed Nov 9, 2023
1 parent 4441672 commit dfd1c59
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions e2e/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"fmt"
"os"
"regexp"
"strings"

"github.com/saucelabs/forwarder/e2e/forwarder"
"github.com/saucelabs/forwarder/e2e/prometheus"
"github.com/saucelabs/forwarder/e2e/setup"
)
Expand Down Expand Up @@ -57,9 +57,14 @@ func main() {

if *args.debug {
for _, srv := range s.Compose.Services {
if strings.HasPrefix(srv.Image, "saucelabs/forwarder") {
switch srv.Name {
case forwarder.ProxyServiceName, forwarder.UpstreamProxyServiceName:
srv.Environment["FORWARDER_LOG_LEVEL"] = "debug"
srv.Environment["FORWARDER_LOG_HTTP"] = "headers"
srv.Environment["FORWARDER_LOG_HTTP"] = "proxy:headers"

case forwarder.HttpbinServiceName:
srv.Environment["FORWARDER_LOG_LEVEL"] = "debug"
srv.Environment["FORWARDER_LOG_HTTP"] = "server:headers"
}
}
}
Expand Down

0 comments on commit dfd1c59

Please sign in to comment.