# queryLog() function · @imqueue/pg-prisma

Source: https://imqueue.org/api/pg-prisma/latest/pg-prisma.querylog/
Published: 2026-08-28
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-prisma 2.0.0 — generated reference, not hand-written

Build the middleware that logs each statement and how long it took.

**Signature:**

```typescript
export declare function queryLog(input: QueryLogOptions): SqlMiddleware;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| input | [QueryLogOptions](https://imqueue.org/api/pg-prisma/latest/pg-prisma.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.

