fix(preview-service): knex should use pino logger (#3004)
This commit is contained in:
Родитель
0ddca29ab8
Коммит
b58d077cf3
|
@ -1,3 +1,4 @@
|
|||
import { knexLogger as logger } from '@/observability/logging.js'
|
||||
import { getPostgresConnectionString, getPostgresMaxConnections } from '@/utils/env.js'
|
||||
import * as knex from 'knex'
|
||||
import { get } from 'lodash-es'
|
||||
|
@ -18,6 +19,11 @@ export const db = knexBuilder({
|
|||
max: getPostgresMaxConnections(),
|
||||
acquireTimeoutMillis: 16000, //allows for 3x creation attempts plus idle time between attempts
|
||||
createTimeoutMillis: 5000
|
||||
},
|
||||
log: {
|
||||
warn: (message) => logger.warn(message),
|
||||
error: (message) => logger.error(message),
|
||||
debug: (message) => logger.debug(message)
|
||||
}
|
||||
// migrations are managed in the server package
|
||||
})
|
||||
|
|
|
@ -11,3 +11,4 @@ export const logger = extendLoggerComponent(
|
|||
)
|
||||
export const serverLogger = extendLoggerComponent(logger, 'server')
|
||||
export const testLogger = getLogger(getLogLevel(), isLogPretty())
|
||||
export const knexLogger = extendLoggerComponent(logger, 'knex')
|
||||
|
|
Загрузка…
Ссылка в новой задаче