queryLog() function

Build the middleware that logs each statement and how long it took.

Signature:

export declare function queryLog(input: QueryLogOptions): SqlMiddleware;

Parameters

Parameter

Type

Description

input

QueryLogOptions

Returns:

SqlMiddleware

Middleware for the middleware array of the postgres() factory.

Remarks

Prisma 7 emitted a query event and this was a $on subscription. Prisma Next has no such event and ships no query logger, so it is a middleware — which is strictly better placed: afterQuery sees the statement as it was finally lowered, after every rewrite, rather than as it was written.

silently() still suppresses it, so startup DDL stays out of the log.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.