Elysia
Import from blyp-js/elysia.
import { Elysia } from "elysia";
import { createLogger } from "blyp-js/elysia";
const app = new Elysia()
.use(createLogger({
level: "debug",
customProps: (ctx) => ({
framework: "elysia",
path: ctx.path,
}),
}))
.get("/hello", ({ log }) => {
log.info("elysia-route");
return "ok";
});How it works
- Blyp decorates the app with
log - request timing starts per request
- success responses emit
http_request - failures emit
http_error - when enabled, client logs are accepted on the configured ingestion path
Relevant types
import type {
ElysiaLoggerConfig,
ElysiaContext,
ResolveCtx,
} from "blyp-js/elysia";