Nuxt
Import from @blyp/core/nuxt. The createLogger() export is an alias of createNuxtLogger().
import { createLogger } from "@blyp/core/nuxt";
const nuxtLogger = createLogger({
level: "info",
});
// server/plugins/blyp.ts
const serverPlugin = nuxtLogger.serverPlugin;
export default serverPlugin;Using the logger in handlers
Use getLogger(event) when you need the request-scoped logger inside a server route or handler:
export default defineEventHandler((event) => {
nuxtLogger.getLogger(event).info("nuxt-route");
return { ok: true };
});Nuxt reuses Blyp's Nitro request lifecycle internally, so request-scoped logging behavior matches the Nitro adapter.
Client ingestion route
Mount the client ingestion handler as a Nuxt server API route:
// server/api/inngest.post.ts
import { createLogger } from "@blyp/core/nuxt";
const nuxtLogger = createLogger();
const clientLogHandler = nuxtLogger.clientLogHandler;
export default clientLogHandler;clientLogHandler is exported as an event handler and uses the configured ingestion path.
What auto-logged requests look like
With automatic request logging enabled, Blyp emits terminal output like:
[INFO] GET /health 200 2ms
[INFO] POST /checkout 200 143ms
[INFO] GET /users/42 404 8ms
[ERROR] POST /payments 500 1203msFields included automatically: method, path, status code, and duration.
In production (NDJSON):
{"level":"info","time":1710000000000,"msg":"GET /health","type":"http_request","method":"GET","url":"/health","statusCode":200,"responseTime":2}
{"level":"info","time":1710000000001,"msg":"POST /checkout","type":"http_request","method":"POST","url":"/checkout","statusCode":200,"responseTime":143}Relevant types
import type {
NuxtEventLike,
NuxtLoggerConfig,
NuxtLoggerFactory,
NuxtLoggerPlugin,
} from "@blyp/core/nuxt";