@loglayer/elysia
v2.1.1
Published
ElysiaJS integration for LogLayer with request-scoped logging, auto request logging, and error handling.
Downloads
179
Maintainers
Readme
ElysiaJS integration for LogLayer
An ElysiaJS plugin for LogLayer that provides request-scoped logging with automatic request/response logging and error handling.
Installation
npm install @loglayer/elysiaUsage
import { Elysia } from "elysia";
import { LogLayer, StructuredTransport } from "loglayer";
import { elysiaLogLayer } from "@loglayer/elysia";
const log = new LogLayer({
transport: new StructuredTransport({ logger: console }),
});
const app = new Elysia()
.use(elysiaLogLayer({ instance: log }))
.get("/", ({ log }) => {
log.info("Hello!");
return "Hello World!";
})
.listen(3000);Documentation
For more details, visit https://loglayer.dev/integrations/elysia
