From 68e6d08c768b789987a753d42f66caf73ce10ee1 Mon Sep 17 00:00:00 2001
From: Daenney
Date: Fri, 17 Feb 2023 12:02:29 +0100
Subject: [feature] Add a request ID and include it in logs (#1476)
This adds a lightweight form of tracing to GTS. Each incoming request is
assigned a Request ID which we then pass on and log in all our log
lines. Any function that gets called downstream from an HTTP handler
should now emit a requestID=value pair whenever it logs something.
Co-authored-by: kim
---
web/template/404.tmpl | 3 ++-
web/template/error.tmpl | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
(limited to 'web')
diff --git a/web/template/404.tmpl b/web/template/404.tmpl
index 3c1769210..bd38c824b 100644
--- a/web/template/404.tmpl
+++ b/web/template/404.tmpl
@@ -29,7 +29,8 @@
If you believe this 404 was an error, you can contact
- the instance admin.
+ the instance admin. Provide them with the following request
+ Request ID: {{.requestID}}.
diff --git a/web/template/error.tmpl b/web/template/error.tmpl
index eb5645c2a..9cc21b296 100644
--- a/web/template/error.tmpl
+++ b/web/template/error.tmpl
@@ -20,6 +20,7 @@
❌ {{.error}}
+ Request ID {{.requestID}}
{{ template "footer.tmpl" .}}
\ No newline at end of file
--
cgit v1.3