From e10c3a51eee362e5c8ed6bb434c24f64442d5bcd Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 5 Jun 2025 19:55:45 +0800 Subject: [PATCH] feat(logger): add debug logging for matched routes (#19287) --- lib/registry.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/registry.ts b/lib/registry.ts index ce693ae9a..d72339f5a 100644 --- a/lib/registry.ts +++ b/lib/registry.ts @@ -9,6 +9,7 @@ import index from '@/routes/index'; import healthz from '@/routes/healthz'; import robotstxt from '@/routes/robots.txt'; import metrics from '@/routes/metrics'; +import logger from '@/utils/logger'; const __dirname = import.meta.dirname; @@ -157,6 +158,7 @@ for (const namespace in namespaces) { for (const [path, routeData] of sortedRoutes) { const wrappedHandler: Handler = async (ctx) => { + logger.debug(`Matched route: ${ctx.req.routePath}`); if (!ctx.get('data')) { if (typeof routeData.handler !== 'function') { if (process.env.NODE_ENV === 'test') {