Merge pull request #7100 from Budibase/fix/pino-logging
Remove health checks from pino messaging
This commit is contained in:
commit
3bdc8d5dbe
|
@ -55,6 +55,7 @@ const env = {
|
|||
DEFAULT_LICENSE: process.env.DEFAULT_LICENSE,
|
||||
SERVICE: process.env.SERVICE || "budibase",
|
||||
MEMORY_LEAK_CHECK: process.env.MEMORY_LEAK_CHECK || false,
|
||||
LOG_LEVEL: process.env.LOG_LEVEL,
|
||||
DEPLOYMENT_ENVIRONMENT:
|
||||
process.env.DEPLOYMENT_ENVIRONMENT || "docker-compose",
|
||||
_set(key: any, value: any) {
|
||||
|
|
|
@ -15,6 +15,7 @@ import auth from "./auth"
|
|||
import constants from "./constants"
|
||||
import * as dbConstants from "./db/constants"
|
||||
import logging from "./logging"
|
||||
import pino from "./pino"
|
||||
|
||||
// mimic the outer package exports
|
||||
import * as db from "./pkg/db"
|
||||
|
@ -53,6 +54,7 @@ const core = {
|
|||
errors,
|
||||
logging,
|
||||
roles,
|
||||
...pino,
|
||||
...errorClasses,
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
const env = require("./environment")
|
||||
|
||||
exports.pinoSettings = () => ({
|
||||
prettyPrint: {
|
||||
levelFirst: true,
|
||||
},
|
||||
level: env.LOG_LEVEL || "error",
|
||||
autoLogging: {
|
||||
ignore: req => req.url.includes("/health"),
|
||||
},
|
||||
})
|
|
@ -15,6 +15,7 @@ const Sentry = require("@sentry/node")
|
|||
const fileSystem = require("./utilities/fileSystem")
|
||||
const bullboard = require("./automations/bullboard")
|
||||
const { logAlert } = require("@budibase/backend-core/logging")
|
||||
const { pinoSettings } = require("@budibase/backend-core")
|
||||
const { Thread } = require("./threads")
|
||||
import redis from "./utilities/redis"
|
||||
import * as migrations from "./migrations"
|
||||
|
@ -35,14 +36,7 @@ app.use(
|
|||
})
|
||||
)
|
||||
|
||||
app.use(
|
||||
pino({
|
||||
prettyPrint: {
|
||||
levelFirst: true,
|
||||
},
|
||||
level: env.LOG_LEVEL || "error",
|
||||
})
|
||||
)
|
||||
app.use(pino(pinoSettings()))
|
||||
|
||||
if (!env.isTest()) {
|
||||
const plugin = bullboard.init()
|
||||
|
|
|
@ -18,7 +18,7 @@ const http = require("http")
|
|||
const api = require("./api")
|
||||
const redis = require("./utilities/redis")
|
||||
const Sentry = require("@sentry/node")
|
||||
import { events } from "@budibase/backend-core"
|
||||
import { events, pinoSettings } from "@budibase/backend-core"
|
||||
|
||||
// this will setup http and https proxies form env variables
|
||||
bootstrap()
|
||||
|
@ -30,14 +30,7 @@ app.keys = ["secret", "key"]
|
|||
// set up top level koa middleware
|
||||
app.use(koaBody({ multipart: true }))
|
||||
app.use(koaSession(app))
|
||||
app.use(
|
||||
logger({
|
||||
prettyPrint: {
|
||||
levelFirst: true,
|
||||
},
|
||||
level: env.LOG_LEVEL || "error",
|
||||
})
|
||||
)
|
||||
app.use(logger(pinoSettings()))
|
||||
|
||||
// authentication
|
||||
app.use(passport.initialize())
|
||||
|
|
Loading…
Reference in New Issue