Skip to content

Commit b188425

Browse files
committed
feat: change reqId to requestId
1 parent 25f9013 commit b188425

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ console.log(isEmail("user@example.com")); // true
5454
- [**String Utilities**](#-string-utilities)
5555
- [**URL Utilities**](#-url-utilities)
5656
- [**Validate Utilities**](#-validate-utilities)
57-
- [**Decorators Utilities**](#decorators-utilities)
57+
- [**Decorators Utilities**](#-decorators-utilities)
5858

5959
---
6060

@@ -146,7 +146,7 @@ import crypto from "crypto";
146146
export function setupRequestContext(req, res, next) {
147147
const requestId = req.headers["x-request-id"]?.toString() || crypto.randomUUID();
148148
ContextStore.run({ [StoreKeys.REQUEST_ID]: requestId }, () => {
149-
const logger = getLogger().child({ reqId: requestId });
149+
const logger = getLogger().child({ requestId });
150150
ContextStore.set(StoreKeys.LOGGER, logger);
151151
logger.info("Request context initialized");
152152
next();

src/utils/context-store.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function getFromContext<T>(key: symbol): T | undefined {
5050
* app.use((req, res, next) => {
5151
* const requestId = req.headers["x-request-id"]?.toString() || crypto.randomUUID();
5252
* ContextStore.run({ [StoreKeys.REQUEST_ID]: requestId }, () => {
53-
* ContextStore.set(StoreKeys.LOGGER, getLogger().child({ reqId: requestId }));
53+
* ContextStore.set(StoreKeys.LOGGER, getLogger().child({ requestId }));
5454
* next();
5555
* });
5656
* });

src/utils/middleware.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export function setupRequestContext(options: { headerName?: string; autoLog?: bo
123123
ContextStore.run({ [StoreKeys.REQUEST_ID]: requestId }, () => {
124124
// Create a child logger for this request
125125
const childLogger = getLogger().child({
126-
reqId: requestId,
126+
requestId,
127127
method: req.method,
128128
url: req.originalUrl || req.url
129129
});

0 commit comments

Comments
 (0)