Integrates winston logging system with your Sails application.
Note: This library requires sails >= 0.11.0
npm install sails-hook-winston
winston is one of the most powerful logging libraries for NodeJS. You can unlock the features of winston in your Sails application when you use this hook.
All available winston transports can be configured through the
The console transport is included by default (by default based on the Sails log options).
This library extend
config/log and use the winston API for setup the Transport. This is an example of configuration:
var path = ;var pkgJSON = ;moduleexportslog =// This options are for Console transport that is used by defaultlevel: 'silly' // you are familiar with this value, right?timestamp: true // if you want to output the timestamp in the console transport// Transports// more information:transports:module:config:dirname: pathdatePattern: '.yyyy-MM-dd.log'filename: pkgJSONnameprettyPrint: truetimestamp: truelevel: 'silly'module: Logioconfig:port: 28777node_name: pkgJSONnamehost: '127.0.0.1';
Note how the options are different for each transport. For example, you can use
info level in console but store
silly level in DailyFileRotate.
MIT © Kiko Beats