Blyp Docs

Fastify

Import from blyp-js/fastify.

import Fastify from "fastify";
import { createLogger } from "blyp-js/fastify";

const app = Fastify();

await app.register(createLogger({
  level: "info",
}));

app.get("/hello", async (request) => {
  request.blypLog.info("fastify-route");
  return { ok: true };
});

What Blyp decorates

  • request.blypLog
  • request.blypStartTime
  • request.blypError

The adapter logs in onResponse, records thrown failures from onError, and registers the client ingestion route when enabled.

Relevant types

import type {
  FastifyLoggerConfig,
  FastifyLoggerPlugin,
} from "blyp-js/fastify";

On this page

No Headings