references/subscribing.md · 24000
E_NEON_REALTIME_URL, parsers: { ...drizzleParsers }, logLevel: import.meta.env.DEV ? "debug" : "warn" })
Entries go to the console unless you pass a [`logger`](https://neon.com/docs/realtime/sdks/typescript.md#client-realtimelogger), which receives each [entry](https://neon.com/docs/realtime/sdks/typescript.md#client-realtimelogentry) instead. An entry has a `level`, a `message`, a `timestamp` and a stable `event` name, like `connection_lost` or `subscription_failed`. Match on `event`, not on `message`:
```ts
logger: (entry) => {
if (entry.event === "subscription_failed") reportError(entry.error)
}
Entries never include sealed queries, SQL, parameters or rows. An entry's error can hold an error from the server or from your own code, so handle it like any other error you log.
The React and TanStack DB bindings log through the client you give them. A direct server takes the same logLevel and logger options in createRealtime({ url }).
Show full database errors
By default, subscription errors carry safe, generic messages. To see the database's own error while you develop, set debugMode on the server that seals your queries:
import { createRealtime } from "@neon/realtime/server"
import { drizzleAdapter } from "@neon/realtime-drizzle"
export const realtime = createRealtime({
secret: process.env.NEON_REALTIME_SECRET!,
db: "neondb",
adapter: drizzleAdapter(),
debugMode: process.env.NODE_ENV === "development"
})
Every query it seals then reports errors with the database's full message, plus its SQLSTATE code in sqlState when there is one. It's a backend option because it travels inside each sealed query.
Warning: Development only
Full error details can expose schema, table and column names to anyone who subscribes, including through any error message your UI shows. Never turn on debugMode in production.