针对Node.js服务的简单和快速JSON日志模块:node-bunyan
jopen
11年前
Bunyan是一个对于node.js services的简单和快速JSON日志库。
var bunyan = require('bunyan'); var log = bunyan.createLogger({name: "myapp"}); log.info("hi"); 还有一个 bunyan CLI 工具用来更好地查看这些日志:

特性
- elegant log method API
- extensible streams system for controlling where log records go (to a stream, to a file, log file rotation, etc.)
bunyanCLI for pretty-printing and filtering of Bunyan logs- simple include of log call source location (file, line, function) with
src: true - lightweight specialization of Logger instances with
log.child - custom rendering of logged objects with "serializers"
- Runtime log snooping via Dtrace support
- Support for browserify. See Browserify section below.