1
0
Fork 0
mirror of synced 2024-07-15 11:15:59 +12:00

Fix pino request id generation (#9324)

Remove the duplicated pino config in favour of the common config. Move request id generation into common configuration
This commit is contained in:
Rory Powell 2023-01-12 10:25:21 +00:00 committed by GitHub
parent 88564b0a7b
commit f85ecd4810
2 changed files with 1 additions and 14 deletions

View file

@ -40,6 +40,7 @@ export function pinoSettings(): Options {
prettyPrint: {
levelFirst: true,
},
genReqId: correlator.getId,
level: env.LOG_LEVEL || "error",
autoLogging: {
ignore: (req: IncomingMessage) => !!req.url?.includes("/health"),

View file

@ -1,14 +0,0 @@
const env = require("./environment")
import { Options } from "pino-http"
const correlator = require("correlation-id")
export const pinoSettings = (): Options => ({
prettyPrint: {
levelFirst: true,
},
genReqId: correlator.getId,
level: env.LOG_LEVEL || "error",
autoLogging: {
ignore: (req: any) => req.url.includes("/health"),
},
})