mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 23:49:27 +08:00
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,
|
path: ctx.url,
|
||||||
};
|
};
|
||||||
requestLogger.info({
|
requestLogger.info({
|
||||||
message: 'request',
|
message: `request ${ctx.method} ${ctx.url}`,
|
||||||
...requestInfo,
|
...requestInfo,
|
||||||
req: pick(ctx.request.toJSON(), options?.requestWhitelist || defaultRequestWhitelist),
|
req: pick(ctx.request.toJSON(), options?.requestWhitelist || defaultRequestWhitelist),
|
||||||
action: ctx.action?.toJSON?.(),
|
action: ctx.action?.toJSON?.(),
|
||||||
@ -51,7 +51,7 @@ export const requestLogger = (appName: string, options?: RequestLoggerOptions) =
|
|||||||
const cost = Date.now() - startTime;
|
const cost = Date.now() - startTime;
|
||||||
const status = ctx.status;
|
const status = ctx.status;
|
||||||
const info = {
|
const info = {
|
||||||
message: 'response',
|
message: `response ${ctx.url}`,
|
||||||
...requestInfo,
|
...requestInfo,
|
||||||
res: pick(ctx.response.toJSON(), options?.responseWhitelist || defaultResponseWhitelist),
|
res: pick(ctx.response.toJSON(), options?.responseWhitelist || defaultResponseWhitelist),
|
||||||
action: ctx.action?.toJSON?.(),
|
action: ctx.action?.toJSON?.(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user