sails-hook-bunyanlog
v1.0.1
Published
Drop-in logger replacement for Sails.js to use Bunyan
Downloads
3
Readme
sails-hook-bunyanlog
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.