mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
feat: Add serving applications on subdomains and port-based proxying (#3753)
Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
@ -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)
|
||||
})
|
||||
|
Reference in New Issue
Block a user