feat: Add serving applications on subdomains and port-based proxying (#3753)

Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
Steven Masley
2022-09-13 13:31:33 -04:00
committed by GitHub
parent 99a7a8dd22
commit 9ab437d6e2
16 changed files with 895 additions and 88 deletions

View File

@ -42,15 +42,13 @@ func Logger(log slog.Logger) func(next http.Handler) http.Handler {
)
}
// We should not log at level ERROR for 5xx status codes because 5xx
// includes proxy errors etc. It also causes slogtest to fail
// instantly without an error message by default.
logLevelFn := httplog.Debug
if sw.Status >= 400 {
logLevelFn = httplog.Warn
}
if sw.Status >= 500 {
// Server errors should be treated as an ERROR
// log level.
logLevelFn = httplog.Error
}
logLevelFn(r.Context(), r.Method)
})