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
Installation
Section titled “Installation”npm install mime-loggerpnpm add mime-loggeryarn add mime-loggerbun add mime-loggerQuick start
Section titled “Quick start”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");
Features
Section titled “Features”- Three log levels —
info,warn,errorwith color-coded output via ansis - Named loggers — attach a name for easy log filtering
- Child loggers — create
parent/childhierarchies withlogger.child(name) - Format presets —
pretty,minimal,detailed,jsonout of the box - Custom formats — format string with tokens or a full
FormatFncallback - 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
