diff --git a/types/pino/index.d.ts b/types/pino/index.d.ts index 678c1fd0c3..8cffeb2803 100644 --- a/types/pino/index.d.ts +++ b/types/pino/index.d.ts @@ -267,6 +267,10 @@ declare namespace P { * The string key for the 'message' in the JSON object. Default: "msg". */ messageKey?: string; + /** + * The string key to place any logged object under. + */ + nestedKey?: string; /** * Enables pino.pretty. This is intended for non-production configurations. This may be set to a configuration * object as outlined in http://getpino.io/#/docs/API?id=pretty. Default: `false`. diff --git a/types/pino/pino-tests.ts b/types/pino/pino-tests.ts index 1508a3ffca..aa9e7c01a4 100644 --- a/types/pino/pino-tests.ts +++ b/types/pino/pino-tests.ts @@ -177,6 +177,10 @@ const withTimeFn = pino({ timestamp: pino.stdTimeFunctions.isoTime, }); +const withNestedKey = pino({ + nestedKey: 'payload', +}); + // Properties/types imported from pino-std-serializers const wrappedErrSerializer = pino.stdSerializers.wrapErrorSerializer((err: pino.SerializedError) => { return {...err, newProp: 'foo'};