Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Latest commit

 

History

History
41 lines (28 loc) · 2.02 KB

README.md

File metadata and controls

41 lines (28 loc) · 2.02 KB

sails-hook-bunyanlog

NPM Version Build Status Coverage Status Runs on Node Built with GNU Make Uses ECMAScript 2015

Replace the built-in Sails.js logger with Bunyan

Description

This hook allows you to use Bunyan with your Sails.js project. It's a drop-in, API-compatible replacement for Sails' built-in Captain's Log, so you do not need to rewrite all your logging code in order to make use of Bunyan.

Usage

sails.log in now an object which is obtained by calling bunyan.createLogger(). Your log.js config file now becomes a bunyan-compatible config file that is passed as-is to the above method. This is the only thing you might have to update after installing this hook (because bunyan has different log levels than Captain's Log).

Also, if you need it, you can access the original bunyan module at sails.hooks.logger.bunyan.

Installation

Just add this npm module into your Sails' package.json:

$ npm install --save sails-hook-bunyanlog

License

This software is licensed under the BSD-3-Clause License. See the LICENSE file for more information.