diff options
author | Vishal Tak <vtak@gitlab.com> | 2022-04-28 13:33:13 +0300 |
---|---|---|
committer | Vishal Tak <vtak@gitlab.com> | 2022-05-16 10:44:42 +0300 |
commit | b81fb34509a9e9754e75975ea8152691fa4c9d10 (patch) | |
tree | 18a10c01d5194f40bd46c9663cca1832b74f0f63 /internal/domain/domain.go | |
parent | 433eb42cb475239fbc9a9af7be4bff01fc2d0a63 (diff) |
Add logs for more visibility in 404s and archive corruption event
Diffstat (limited to 'internal/domain/domain.go')
-rw-r--r-- | internal/domain/domain.go | 4 |
1 files changed, 4 insertions, 0 deletions
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 } |