mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add ignorePath option to koa-bunyan-logger RequestLoggerOptions (#35264)
This commit is contained in:
parent
e63cb5725e
commit
c4edb7ea59
1
types/koa-bunyan-logger/index.d.ts
vendored
1
types/koa-bunyan-logger/index.d.ts
vendored
@ -36,6 +36,7 @@ declare namespace koaBunyanLogger {
|
||||
updateResponseLogFields?: (responseData: ResponseData) => ResponseData;
|
||||
formatRequestMessage?: (requestData: RequestData) => string;
|
||||
formatResponseMessage?: (responseData: ResponseData) => string;
|
||||
ignorePath?: string[];
|
||||
}
|
||||
|
||||
function requestLogger(opts?: RequestLoggerOptions): Middleware;
|
||||
|
||||
@ -5,6 +5,7 @@ const app = new Koa();
|
||||
app.use(koaBunyanLogger());
|
||||
app.use(koaBunyanLogger.requestIdContext());
|
||||
app.use(koaBunyanLogger.requestLogger());
|
||||
app.use(koaBunyanLogger.requestLogger({ ignorePath: ['/ping'] }));
|
||||
|
||||
app.use(async (ctx, next) => {
|
||||
ctx.log.info('Got a request from %s for %s', ctx.request.ip, ctx.path);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user