Spaces:
Sleeping
Sleeping
Download src/libs/shared/presentation/http/middleware/foundational/LoggerMiddleware.ts from fouadkhalid123/asd: direct link, hf CLI and curl.
- Browser
- Download file 423 Bytes
-
https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/presentation/http/middleware/foundational/LoggerMiddleware.ts
- Command line
-
hf download hf://spaces/fouadkhalid123/asd/src/libs/shared/presentation/http/middleware/foundational/LoggerMiddleware.ts
-
curl -L -o LoggerMiddleware.ts https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/presentation/http/middleware/foundational/LoggerMiddleware.ts
423 Bytes
| import { Request, Response, NextFunction } from "express"; | |
| export const LoggerMiddleware = (req: Request, res: Response, next: NextFunction) => { | |
| const requestId = req.headers["x-request-id"] || "unknown"; | |
| const tenantId = req.tenantContext?.organizationId || "unknown"; | |
| console.log(`[${new Date().toISOString()}] ${req.method} ${req.path} | RequestID: ${requestId} | TenantID: ${tenantId}`); | |
| next(); | |
| }; | |