@loglayer/hono
v2.1.0
Published
Hono integration for LogLayer with request-scoped logging, auto request logging, and error handling.
Maintainers
Readme
Hono integration for LogLayer
A Hono middleware for LogLayer that provides request-scoped logging with automatic request/response logging and error handling.
Installation
npm install @loglayer/honoUsage
import { Hono } from "hono";
import { LogLayer, StructuredTransport } from "loglayer";
import { honoLogLayer, type HonoLogLayerVariables } from "@loglayer/hono";
const log = new LogLayer({
transport: new StructuredTransport({ logger: console }),
});
const app = new Hono<{ Variables: HonoLogLayerVariables }>();
app.use(honoLogLayer({ instance: log }));
app.get("/", (c) => {
c.var.logger.info("Hello!");
return c.text("Hello World!");
});
export default app;Documentation
For more details, visit https://loglayer.dev/integrations/hono
