bunyan-mongodb v1.2.3 (latest as of 2025) provides a MongoDB stream for Bunyan logger. It allows logging directly to a MongoDB collection with optional batch writes. Requires bunyan as a peer dependency. Compared to other MongoDB logging solutions, it integrates seamlessly with Bunyan's stream API. Last released 3 years ago, known as stable but not actively maintained. Ships TypeScript definitions.
npm install bunyan-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Bunyan logger that writes to MongoDB using bunyan-mongodb. Requires bunyan as peer dependency. Uses environment variables for credentials.
Set batchSize to a reasonable value (e.g., 100) to avoid performance issues.
Consider alternatives like winston-mongodb or upgrade to a maintained fork.
Explicitly set authDatabase if using non-admin credentials.
npm install bunyan as a dependency.
npm install bunyan
const bunyanMongo = require('bunyan-mongodb');Provide correct authDatabase (default 'admin') in options.