Winston is one of the most popular Node logging libraries. It is simple and supports logging to multiple transports.
Winston comes with file- and console-based transports, but many others are available on npmjs.org. For example:
Winston also has a Splunk transport:
For information on additional transports and other options, see https://github.com/flatiron/winston.
Bunyan provides structured machine-readable logging.
Use Bunyan; for example:
The above code would produce the output such as the following:
Bunyan enables you to create separate child loggers for each sub-component of your application.
For example, in Express you might use a child logger per request.
This would produce a log such as the following: