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:
parent
88564b0a7b
commit
f85ecd4810
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
},
|
||||
})
|
Loading…
Reference in New Issue