Skip to content

Commit

Permalink
fix(logging): redact detail in database error message (#2642)
Browse files Browse the repository at this point in the history
- may contain secrets which should not be logged
  • Loading branch information
iainsproat authored Aug 12, 2024
1 parent 595f76f commit a0a1363
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/server/logging/knexMonitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { numberOfFreeConnections } from '@/modules/shared/helpers/dbHelper'
import { type Knex } from 'knex'
import { Logger } from 'pino'
import { toNDecimalPlaces } from '@/modules/core/utils/formatting'
import { omit } from 'lodash'

export const initKnexPrometheusMetrics = (params: {
db: Knex
Expand Down Expand Up @@ -162,7 +163,7 @@ export const initKnexPrometheusMetrics = (params: {
metricQueryErrors.inc()
params.logger.warn(
{
err,
err: omit(err, 'detail'),
sql: querySpec.sql,
sqlMethod: normalizeSqlMethod(querySpec.method),
sqlQueryId: queryId,
Expand Down

0 comments on commit a0a1363

Please sign in to comment.