diff --git a/types/pino-http/index.d.ts b/types/pino-http/index.d.ts index 8d685e7998..5ac016d2c7 100644 --- a/types/pino-http/index.d.ts +++ b/types/pino-http/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for pino-http 4.4 +// Type definitions for pino-http 5.0 // Project: https://github.com/pinojs/pino-http#readme // Definitions by: Christian Rackerseder // Jeremy Forsythe // Griffin Yourick +// Jorge Barnaby // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 @@ -38,6 +39,7 @@ declare namespace PinoHttp { interface autoLoggingOptions { ignorePaths?: string[]; + getPath?: (req: IncomingMessage) => string | undefined; } } diff --git a/types/pino-http/pino-http-tests.ts b/types/pino-http/pino-http-tests.ts index 900cf16daf..84e37aa730 100644 --- a/types/pino-http/pino-http-tests.ts +++ b/types/pino-http/pino-http-tests.ts @@ -20,6 +20,7 @@ pinoHttp({ useLevel: 'error' }); pinoHttp({ prettyPrint: true }); pinoHttp({ autoLogging: false }); pinoHttp({ autoLogging: { ignorePaths: ['/health'] } }); +pinoHttp({ autoLogging: { ignorePaths: ['/health'], getPath: (req) => req.url } }); pinoHttp(new Writable()); pinoHttp({ customLogLevel(req, res) {