mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 04:26:43 -06:00
feat: add request ID propagation from Rust to Bun with structured logging
- Forward x-request-id header through proxy and API calls - Store RequestId in request extensions for downstream access - Add AsyncLocalStorage context to correlate logs across async boundaries - Improve migration logging to show pending changes before applying - Reduce noise in logs (common OG images, health checks)
This commit is contained in:
@@ -29,6 +29,9 @@ function stripAnsi(str: string): string {
|
||||
return str.replace(/\u001b\[[0-9;]*m/g, "").trim();
|
||||
}
|
||||
|
||||
// Module-level flag to prevent reconfiguration across plugin instantiations
|
||||
let loggerConfigured = false;
|
||||
|
||||
export function jsonLogger(): Plugin {
|
||||
const useJsonLogs =
|
||||
process.env.LOG_JSON === "true" || process.env.LOG_JSON === "1";
|
||||
@@ -39,7 +42,6 @@ export function jsonLogger(): Plugin {
|
||||
};
|
||||
}
|
||||
|
||||
let loggerConfigured = false;
|
||||
const configureLogger = async () => {
|
||||
if (loggerConfigured) return;
|
||||
await configure({
|
||||
|
||||
Reference in New Issue
Block a user