summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2025-05-11 16:20:45 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2025-05-11 16:29:37 -0700
commit30729a0cf707d9022bae0a7baaba77379dc31fd5 (patch)
tree078f54b38de7fa1c5cc3c1fc8887bb292896cbfb /hooks
parentb241180aa85ad81f4ee0dca9bf3c0429916a6a18 (diff)
downloadci-30729a0cf707d9022bae0a7baaba77379dc31fd5.tar.gz
ci-30729a0cf707d9022bae0a7baaba77379dc31fd5.zip
Use closure over trace id instead of initializing it every log line.
Fix laminar ownership :(
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/mod.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/hooks/mod.ts b/hooks/mod.ts
index 8771bea..f858ad0 100755
--- a/hooks/mod.ts
+++ b/hooks/mod.ts
@@ -9,10 +9,11 @@ import {
const getRequestLogger = (req: Request) => {
const url = new URL(req.url);
+ const traceId = crypto.randomUUID();
const getPrefix = () =>
`[${
new Date().toISOString()
- }] RequestTrace=[${crypto.randomUUID()}] @ [${url.pathname}] -X [${req.method}] |`;
+ }] RequestTrace=[${traceId}] @ [${url.pathname}] -X [${req.method}] |`;
return loggerWithPrefix(getPrefix);
};