Skip to main content

Interface: StructuredQueryLoggerOptions

Defined in: src/observability/StructuredQueryLogger.ts:5

Properties​

prefix?​

optional prefix?: string

Defined in: src/observability/StructuredQueryLogger.ts:10

Log badge / prefix. Defaults to 'prisma:query' to match Prisma's output style, or custom string e.g. 'entityTS:query'.


format?​

optional format?: LogFormat

Defined in: src/observability/StructuredQueryLogger.ts:18

Structured format:

  • 'prisma': Multi-line format displaying query, duration, and parameters (Prisma default)
  • 'compact': Single-line formatted log
  • 'json': Structured JSON object for CloudWatch, Datadog, ELK

colorize?​

optional colorize?: boolean

Defined in: src/observability/StructuredQueryLogger.ts:24

Whether to include ANSI terminal colors. Defaults to true when output is an interactive terminal (TTY) or not explicitly disabled.


logger?​

optional logger?: (message) => void

Defined in: src/observability/StructuredQueryLogger.ts:30

Custom output destination callback. Defaults to console.log (or console.error for failed queries).

Parameters​

ParameterType
messagestring

Returns​

void


slowThresholdMs?​

optional slowThresholdMs?: number

Defined in: src/observability/StructuredQueryLogger.ts:36

Execution time threshold in milliseconds above which a query is flagged as slow. Defaults to 100 ms.