Skip to main content

Logging

Enable focused client and server diagnostics while keeping sensitive values out of logs.

Logging is disabled by default.

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@lupinum/better-convex-nuxt'],
  convex: {
    logging: 'info',
  },
})

Levels

LevelOutput
falseNo module logs
infoAuth, writes, actions, uploads, and connection events
debugInfo plus queries, timings, and detailed debug events

Query events are debug-only because live updates can be noisy.

Auth debugging

Auth diagnostics use the same root log level as every other runtime boundary:

ts
convex: {
  logging: 'debug',
  auth: {
    origin: process.env.SITE_URL ?? 'http://localhost:3000'
  }
}

Debug output covers SSR session resolution, the same-origin auth proxy, and auth-client initialization with reviewed outcome codes and sanitized timing metadata. There are no nested auth debug channels or request-controlled tracing switches.

Sanitization

Module diagnostics sanitize depth, item count, long strings, and sensitive key patterns before output. Generic debug payloads and error objects are deliberately omitted: trace events use reviewed metadata fields instead. This reduces accidental leakage; it does not make arbitrary application logging safe.

Never add session tokens, cookies, authorization headers, raw URLs with queries, raw upstream bodies, error objects, or file contents to logging metadata.

Production

Keep module logging disabled or at info for a measured operational need. Debug logging can expose query shapes and create substantial volume.

For external monitoring, capture normalized error kinds and application-owned correlation IDs.

ConvexCallError.toJSON() is the public application error representation, not a ready-made telemetry payload: structured server message and data are application-owned values and may be high-cardinality or intentionally visible only to the current caller. Project an explicit allowlist for monitoring. The public error does not retain the raw upstream cause.