Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sails-hook-winston2

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sails-hook-winston2

Integrates winston logging system with your Sails application based in sails-hook-winston

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

sails-hook-winston

Build Status Coverage Status Dependency status Dev Dependencies Status NPM Status Gittip

Integrates winston logging system with your Sails application, based in sails-hook-winston by @Kikobeats.

Install

Note: This library requires sails >= 0.11.0

npm install sails-hook-winston2

Usage

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 transports option. The console transport is included by default (by default based on the Sails log options).

API

This library extend config/log and use the winston API for setup the Transport. This is an example of configuration:

var path = require('path');
var pkgJSON = require(path.resolve('package.json'));

module.exports.log = {

  // This options are for Console transport that is used by default
  level: 'silly', // you are familiar with this value, right?
  timestamp: true, // if you want to output the timestamp in the console transport
  colorize: true, // colorize console transport
  prettyPrint: true, // pretty print console transport
  showLevel: true, // show level in console transport

  // ... other console transport options.

  // Transports
  // more information: https://github.com/winstonjs/winston/blob/master/docs/transports.md
  transports: [
    {
      module: require('winston-daily-rotate-file'),
      config: {
        dirname: path.resolve('logs'),
        datePattern: '.yyyy-MM-dd.log',
        filename: pkgJSON.name,
        prettyPrint: true,
        timestamp: true,
        level: 'silly'
      }
    },
    {
      module: require('winston-logio').Logio,
      config: {
        port: 28777,
        node_name: pkgJSON.name,
        host: '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.

License

MIT © Michael Salgado

Keywords

FAQs

Package last updated on 30 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc