Skip to content

peterujvari/node-winston-logger-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-winston-logger-adapter

This package is used for logging using winston.

Installation

npm install winston-logger-adapter

Example

var logger = require('.');

var config = {
  level: 'debug',
  enableMails: true,
  mailConfig: {
    to: '', // Example Leslie <[email protected]>
    host: "",
    port: 465,
    ssl: true,
    username: '',
    password: '',
    subject: 'Example subject',
    from: 'Example Sender <[email protected]>', // EX: 'I'M A BOT <[email protected]>, ...'
    level: 'error'
  },
  enableSentry: true,
  sentryConfig: {
    level: 'error',
    dsn: '{{ YOUR SENTRY DSN }}'
  }
}

logger.initAdapter({}, config);

logger.log('error', 'asdadasda');