Demonstrates evlog integration with SolidStart (Nitro v2 via Vinxi).
bun install
bun run devGET /api/hello— simple wide event withuseLoggerPOST /api/checkout— structured error withcreateError
Open the terminal to see evlog's pretty-printed output.
SolidStart uses Nitro v2 through Vinxi. The evlog plugin and error handler are registered in app.config.ts via server.plugins and server.errorHandler:
import { dirname, resolve } from "node:path"
import { fileURLToPath } from "node:url"
import { defineConfig } from "@solidjs/start/config"
const evlogDir = dirname(fileURLToPath(import.meta.resolve("evlog/nitro")))
process.env.__EVLOG_CONFIG = JSON.stringify({
env: { service: "solidstart-example" },
include: ["/api/**"],
})
export default defineConfig({
server: {
plugins: [resolve(evlogDir, "plugin")],
errorHandler: resolve(evlogDir, "errorHandler"),
},
})In API routes, use useLogger(event.nativeEvent) to access the request-scoped logger — event.nativeEvent gives you the underlying H3 event that evlog hooks into.