Socket
Socket
Sign inDemoInstall

easy-winston-logger

Package Overview
Dependencies
47
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    easy-winston-logger

Logger for Node.js servers


Version published
Weekly downloads
6
decreased by-77.78%
Maintainers
1
Install size
8.74 MB
Created
Weekly downloads
 

Readme

Source

Easy Winston Logger

Setup

npm install --save easy-winston-logger

Usage

let config = {
    turnOff: false,
    type: 'file',
    //you may have only the used option, in this case file
    options: {
      mongodb: {
        db: 'mongodb://localhost:27017/logs',
        collection: 'logs',
        level: process.env.LOG_LEVEL || 'error',
        timestamp: true
      },
      file: {
        name: 'filename',
        maxsize: 10240,
        level: 'silly',
        timestamp: true
      },
      console: {
        colorize: 'all',
        level: 'debug',
        timestamp: true
      }
    }
  };

let logger = require('easy-winston-logger')(config);
// or
let logger = require('easy-winston-logger')('mongodb');// options may be console, mongodb or file

logger.info('This is an info');
logger.debug('This is a debug');
logger.error('This is an error');

Keywords

FAQs

Last updated on 27 Jan 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc