0.2.0 • Published 1 year ago

@s9y/fastify-request-logging v0.2.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Fastify request logging

Installation

Install @s9y/fastify-request-logging with npm

# npm
npm install @s9y/fastify-request-logging

# pnpm
pnpm install @s9y/fastify-request-logging

# yarn
yarn add @s9y/fastify-request-logging

Usage

Basic example

import fastifyRouteLogging from "@s9y/fastify-request-logging"

const fastify = Fastify({ logger: true, disableRequestLogging: true })
await fastify.register(fastifyRouteLogging, { logLevel: "info" })

fastify.get("/", async () => ({ hello: "world" }))
await fastify.listen({ port: 3000 })

Development

Start example fastify server with @s9y/fastify-request-logging.

pnpm dev:example

Run some requests.

curl 'http://localhost:3000/?test=1'