Skip to content

mime-logger

Simple, opinionated Node.js logger with colored output, file logging, child logger support, and zero config to get started. Supports ESM + CJS.

Stable · 2.2.0npm install mime-logger

Terminal window
npm install mime-logger
import Logger from "mime-logger";
const logger = new Logger("app");
logger.info("Server started on port 3000");
logger.warn("Low memory warning");
logger.error("Failed to connect to database");
Quick start output
  • Three log levelsinfo, warn, error with color-coded output via ansis
  • Named loggers — attach a name for easy log filtering
  • Child loggers — create parent/child hierarchies with logger.child(name)
  • Format presetspretty, minimal, detailed, json out of the box
  • Custom formats — format string with tokens or a full FormatFn callback
  • File output — write to rotating log files with time-based path tokens
  • Multiple outputs — console and file simultaneously
  • Dual build — ESM and CJS, TypeScript types included