Node.js logging libraries
Notable libraries to write logs in Node.js applications
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
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.
Bunyan is a simple and fast JSON logging library for node.js services, extensible streams system for controlling where log records go.
HTTP request logger middleware for node.js
Signale can be used for logging purposes, status reporting, as well as for handling the output rendering process of other node modules and applications.
The logger util that npm uses, very basic, supports custom levels and colored output, all logs written to stderr by default.