Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuomo Ala-Vannesluoma <tuomoav@gmail.com>2019-09-26 16:35:28 +0300
committerNick Thomas <nick@gitlab.com>2019-09-26 16:35:28 +0300
commitc781a7ccd3147f750faeda631db15d06de455949 (patch)
treec2d190d278bb270eed5b2ecae0ba9e77f84e1577 /internal/logging
parent218376d484a8ec55882b037475ec3201d1c897cf (diff)
Add support for previewing artifacts that are not public
Remove some duplicate logic on Auth module Separate handling artifact to own handlers package Unit test handlers by mocking auth and artifact modules Add generate-mock step to Makefile Use additional handler func to simplify TryMakeRequest return type Always try with token if exists Do not log RequestURI, log path only Remove not used logRequest func
Diffstat (limited to 'internal/logging')
-rw-r--r--internal/logging/logging.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/logging/logging.go b/internal/logging/logging.go
index f0682573..9269261d 100644
--- a/internal/logging/logging.go
+++ b/internal/logging/logging.go
@@ -78,3 +78,11 @@ func AccessLogger(handler http.Handler, format string) (http.Handler, error) {
log.WithAccessLogger(accessLogger),
), nil
}
+
+// LogRequest will inject request host and path to the logged messages
+func LogRequest(r *http.Request) *logrus.Entry {
+ return log.WithFields(log.Fields{
+ "host": r.Host,
+ "path": r.URL.Path,
+ })
+}