Blyp Docs

Hono

Import from @blyp/core/hono.

import { Hono } from "hono";
import { createLogger } from "@blyp/core/hono";

const app = new Hono();

app.use("*", createLogger({
  level: "info",
  customProps: () => ({ framework: "hono" }),
}));

app.get("/hello", (context) => {
  context.get("blypLog").info("hono-route");
  return context.text("ok");
});

Notes

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  1203ms

Fields 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 {
  HonoLoggerConfig,
  HonoLoggerVariables,
} from "@blyp/core/hono";