針對Node.js服務的簡單和快速JSON日志模塊:node-bunyan
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.)
bunyan
CLI 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.
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!