Node logging libraries

Updated on May 06, 2021listsnodelibraries

Getting started with JavaScript and logging your first line using console.log is quick, but when you take your code to production, there’s much more you should consider about logging:

  • Output formats (string, json, files, streams, etc.)
  • Different log levels for different log categories
  • Multiple configurable writable streams
  • Interactive and regular modes
  • String interpolation support
  • Configurable log rolling based on file size or date

Editor's Picks

image

winston

Winston is designed to be a simple and universal logging library with support for multiple transports. A transport is essentially a storage device for your logs.
image

bunyan

Bunyan is a simple and fast JSON logging library for node.js services, extensible streams system for controlling where log records go.
image

morgan

HTTP request logger middleware for node.js
image

debug

A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers
image

signale

Signale can be used for logging purposes, status reporting, as well as for handling the output rendering process of other node modules and applications.
image

log4js

This is a conversion of the log4js framework to work with node. I started out just stripping out the browser-specific code and tidying up some of the javascript to work better in node
image

loglevel

Minimal lightweight logging for JavaScript, adding reliable log level methods to wrap any available console.log methods
image

npmlog

The logger util that npm uses, very basic, supports custom levels and colored output, all logs written to stderr by default.