Skip to content

Commit b8947f1

Browse files
committed
logging: Add path to request object.
1 parent 0664633 commit b8947f1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/app/common/middleware/logger.middleware.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export function koaLogger() {
6060
ctx.state.request = {
6161
id: randomString.generate(10),
6262
ip: ctx.request.get('x-forwarded-for') || ctx.ip || undefined,
63+
path: ctx.request.path,
6364
};
6465
ctx.response.set('X-Request-Id', ctx.state.request.id);
6566
try {

src/app/common/typings/context.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ export interface RequestState {
6868
*/
6969
id: string;
7070

71+
/**
72+
* The (internal) path, so we can determine if it's a storage or API request.
73+
*/
74+
path: string;
75+
7176
/**
7277
* Request duration in ms
7378
*/

0 commit comments

Comments
 (0)