From b81fb34509a9e9754e75975ea8152691fa4c9d10 Mon Sep 17 00:00:00 2001 From: Vishal Tak Date: Thu, 28 Apr 2022 16:03:13 +0530 Subject: Add logs for more visibility in 404s and archive corruption event --- internal/domain/domain.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'internal/domain/domain.go') diff --git a/internal/domain/domain.go b/internal/domain/domain.go index 76a1cf25..f6022b35 100644 --- a/internal/domain/domain.go +++ b/internal/domain/domain.go @@ -9,6 +9,7 @@ import ( "gitlab.com/gitlab-org/gitlab-pages/internal/errortracking" "gitlab.com/gitlab-org/gitlab-pages/internal/httperrors" + "gitlab.com/gitlab-org/gitlab-pages/internal/logging" "gitlab.com/gitlab-org/gitlab-pages/internal/serving" ) @@ -126,6 +127,7 @@ func (d *Domain) ServeFileHTTP(w http.ResponseWriter, r *http.Request) bool { if err != nil { if errors.Is(err, ErrDomainDoesNotExist) { // serve generic 404 + logging.LogRequest(r).WithError(ErrDomainDoesNotExist).Error("unable to find any lookup path for domain while serving file") httperrors.Serve404(w) return true } @@ -144,6 +146,7 @@ func (d *Domain) ServeNotFoundHTTP(w http.ResponseWriter, r *http.Request) { if err != nil { if errors.Is(err, ErrDomainDoesNotExist) { // serve generic 404 + logging.LogRequest(r).WithError(ErrDomainDoesNotExist).Error("unable to find any lookup path for domain while serving the not found pages") httperrors.Serve404(w) return } @@ -168,6 +171,7 @@ func (d *Domain) ServeNamespaceNotFound(w http.ResponseWriter, r *http.Request) if err != nil { if errors.Is(err, ErrDomainDoesNotExist) { // serve generic 404 + logging.LogRequest(r).WithError(ErrDomainDoesNotExist).Error("unable to find any lookup path for domain while finding parent namespace domain for a request that failed authentication") httperrors.Serve404(w) return } -- cgit v1.2.3