Logging type updates to fix account portal build (#9317)
This commit is contained in:
parent
6229390451
commit
34ee521961
|
@ -64,6 +64,7 @@
|
||||||
"@types/jest": "27.5.1",
|
"@types/jest": "27.5.1",
|
||||||
"@types/koa": "2.13.4",
|
"@types/koa": "2.13.4",
|
||||||
"@types/koa-pino-logger": "3.0.0",
|
"@types/koa-pino-logger": "3.0.0",
|
||||||
|
"@types/pino-http": "5.8.1",
|
||||||
"@types/lodash": "4.14.180",
|
"@types/lodash": "4.14.180",
|
||||||
"@types/node": "14.18.20",
|
"@types/node": "14.18.20",
|
||||||
"@types/node-fetch": "2.6.1",
|
"@types/node-fetch": "2.6.1",
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import { Header } from "./constants"
|
import { Header } from "./constants"
|
||||||
import env from "./environment"
|
import env from "./environment"
|
||||||
const correlator = require("correlation-id")
|
const correlator = require("correlation-id")
|
||||||
|
import { Options } from "pino-http"
|
||||||
|
import { IncomingMessage } from "http"
|
||||||
|
|
||||||
const NonErrors = ["AccountError"]
|
const NonErrors = ["AccountError"]
|
||||||
|
|
||||||
|
@ -33,14 +35,14 @@ export function logWarn(message: string) {
|
||||||
console.warn(`bb-warn: ${message}`)
|
console.warn(`bb-warn: ${message}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function pinoSettings() {
|
export function pinoSettings(): Options {
|
||||||
return {
|
return {
|
||||||
prettyPrint: {
|
prettyPrint: {
|
||||||
levelFirst: true,
|
levelFirst: true,
|
||||||
},
|
},
|
||||||
level: env.LOG_LEVEL || "error",
|
level: env.LOG_LEVEL || "error",
|
||||||
autoLogging: {
|
autoLogging: {
|
||||||
ignore: (req: { url: string }) => req.url.includes("/health"),
|
ignore: (req: IncomingMessage) => !!req.url?.includes("/health"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1239,7 +1239,7 @@
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.20.tgz#268f028b36eaf51181c3300252f605488c4f0650"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.20.tgz#268f028b36eaf51181c3300252f605488c4f0650"
|
||||||
integrity sha512-Q8KKwm9YqEmUBRsqJ2GWJDtXltBDxTdC4m5vTdXBolu2PeQh8LX+f6BTwU+OuXPu37fLxoN6gidqBmnky36FXA==
|
integrity sha512-Q8KKwm9YqEmUBRsqJ2GWJDtXltBDxTdC4m5vTdXBolu2PeQh8LX+f6BTwU+OuXPu37fLxoN6gidqBmnky36FXA==
|
||||||
|
|
||||||
"@types/pino-http@*":
|
"@types/pino-http@*", "@types/pino-http@5.8.1":
|
||||||
version "5.8.1"
|
version "5.8.1"
|
||||||
resolved "https://registry.yarnpkg.com/@types/pino-http/-/pino-http-5.8.1.tgz#ebb194750ad2f9245c3028b5d2c4e6d64f685ba9"
|
resolved "https://registry.yarnpkg.com/@types/pino-http/-/pino-http-5.8.1.tgz#ebb194750ad2f9245c3028b5d2c4e6d64f685ba9"
|
||||||
integrity sha512-A9MW6VCnx5ii7s+Fs5aFIw+aSZcBCpsZ/atpxamu8tTsvWFacxSf2Hrn1Ohn1jkVRB/LiPGOapRXcFawDBnDnA==
|
integrity sha512-A9MW6VCnx5ii7s+Fs5aFIw+aSZcBCpsZ/atpxamu8tTsvWFacxSf2Hrn1Ohn1jkVRB/LiPGOapRXcFawDBnDnA==
|
||||||
|
|
Loading…
Reference in New Issue