Skip to content

Commit

Permalink
feat(logger): add ip address to logs for debugging purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
coldlink committed Sep 9, 2024
1 parent 9b5cb08 commit 5e5b2a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/server/lib/middleware/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const loggerMiddleware = (
) => {
logger.info(`${req.method}, ${req.path}`, undefined, {
request_id: req.get('x-request-id'),
ip: req.ip,
});
next();
};
1 change: 1 addition & 0 deletions src/shared/lib/baseLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { LogLevel, Logger } from '@/shared/model/Logger';

export interface ExtraLogFields {
request_id?: string;
ip?: string;
[key: string]: any;
}

Expand Down

0 comments on commit 5e5b2a4

Please sign in to comment.