sails-hook-bunyanlog

1.0.1 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i sails-hook-bunyanlog

Weekly Downloads

1

Version

1.0.1

License

BSD-3-Clause

Last publish

Collaborators

  • dreamscapes