hono-pino-logger

raw JSON →
1.0.0 verified Sat Apr 25 auth: no javascript

Pino logger middleware for Hono v1.0.0. Integrates the high-performance Pino logger with the Hono web framework. Releases follow semver. Key differentiator: lightweight, type-safe, and minimal configuration compared to other Hono logging solutions.

error Error: Cannot find module 'hono-pino-logger'
cause Package not installed or typo in package name
fix
Run 'npm install hono-pino-logger' and check spelling
error TypeError: pinoLogger is not a function
cause Using default import instead of named import
fix
Use '{ pinoLogger }' in import statement
error Error: hono must be version >=4
cause Installed hono version is lower than 4
fix
Update hono: npm install hono@latest
breaking hono version must be >=4
fix Ensure hono version in package.json is >=4.0.0
gotcha pino-pretty not included; must be installed separately for pretty-printing
fix npm install pino-pretty and configure pino accordingly
gotcha Logger must be attached before route handlers to log requests
fix Call app.use('*', pinoLogger()) before registering routes
npm install hono-pino-logger
yarn add hono-pino-logger
pnpm add hono-pino-logger

Creates a Hono app with Pino logging for all routes using default logger.

import { Hono } from 'hono'
import { pinoLogger } from 'hono-pino-logger'

const app = new Hono()
app.use('*', pinoLogger())
app.get('/', (c) => c.text('Hello'))
export default app