chore(logger): append url to request log message (#3296)
This commit is contained in:
parent
e99c2f2011
commit
66ee3f6864
@ -35,7 +35,7 @@ export const requestLogger = (appName: string, options?: RequestLoggerOptions) =
|
||||
path: ctx.url,
|
||||
};
|
||||
requestLogger.info({
|
||||
message: 'request',
|
||||
message: `request ${ctx.method} ${ctx.url}`,
|
||||
...requestInfo,
|
||||
req: pick(ctx.request.toJSON(), options?.requestWhitelist || defaultRequestWhitelist),
|
||||
action: ctx.action?.toJSON?.(),
|
||||
@ -51,7 +51,7 @@ export const requestLogger = (appName: string, options?: RequestLoggerOptions) =
|
||||
const cost = Date.now() - startTime;
|
||||
const status = ctx.status;
|
||||
const info = {
|
||||
message: 'response',
|
||||
message: `response ${ctx.url}`,
|
||||
...requestInfo,
|
||||
res: pick(ctx.response.toJSON(), options?.responseWhitelist || defaultResponseWhitelist),
|
||||
action: ctx.action?.toJSON?.(),
|
||||
|
Loading…
Reference in New Issue
Block a user