diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/auth/auth.go | 6 | ||||
-rw-r--r-- | internal/httprange/http_reader.go | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 2f0395df..98bbf49d 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -18,6 +18,7 @@ import ( "github.com/gorilla/sessions" "github.com/sirupsen/logrus" "gitlab.com/gitlab-org/labkit/errortracking" + "gitlab.com/gitlab-org/labkit/log" "golang.org/x/crypto/hkdf" "gitlab.com/gitlab-org/gitlab-pages/internal/httperrors" @@ -538,7 +539,10 @@ func (a *Auth) checkAuthentication(w http.ResponseWriter, r *http.Request, domai if resp.StatusCode != http.StatusOK { // call serve404 handler when auth fails err := fmt.Errorf("unexpected response fetching access token status: %d", resp.StatusCode) - logRequest(r).WithError(err).WithField("status", resp.Status).Error("Unexpected response fetching access token") + logRequest(r).WithError(err).WithFields(log.Fields{ + "status": resp.StatusCode, + "status_text": resp.Status, + }).Error("Unexpected response fetching access token") captureErrWithReqAndStackTrace(err, r) domain.ServeNotFoundAuthFailed(w, r) return true diff --git a/internal/httprange/http_reader.go b/internal/httprange/http_reader.go index b9affc6d..08779bc8 100644 --- a/internal/httprange/http_reader.go +++ b/internal/httprange/http_reader.go @@ -87,7 +87,10 @@ func (r *Reader) ensureResponse() error { // cleanup body on failure from r.setResponse to avoid memory leak res.Body.Close() - logging.LogRequest(req).WithError(err).WithField("status", res.Status).Error(rangeRequestFailedErrMsg) + logging.LogRequest(req).WithError(err).WithFields(log.Fields{ + "status": res.StatusCode, + "status_text": res.Status, + }).Error(rangeRequestFailedErrMsg) } return err |