3.0.2 • Published 7 years ago

@rappestad/winston-nodemailer v3.0.2

Weekly downloads
50
License
MIT
Repository
github
Last release
7 years ago

@rappestad/winston-nodemailer

A nodemailer transport for winston

npm (scoped) license Build Status Coverage Status David David

Installation

Install the module and the typescript definitions:

npm install winston --save
npm install @rappestad/winston-nodemailer --save

Example

import * as winston from 'winston'
import { WinstonNodemailer } from '@rappestad/winston-nodemailer'

winston.configure({
  transports: [
    // log to console
    new winston.transports.Console({
      timestamp: () => (new Date()).toLocaleTimeString(),
      colorize: true,
      level: 'debug'
    }),

    // log to email
    new WinstonNodemailer({
      // check nodemailer for options available for the smtp transport
      host: 'example.com',
      port: 25,
      to: 'example@example.com',
      from: '"Winston" <noreply@example.com>',
      subject: 'Oi, here are some log entries!',

      // default: 'error'
      level: 'warn',

      // wait for additional log entries for 1000 ms
      // before sending the email
      // default: 60000 (1 minute)
      debounce: 1000
    })
  ]
})
3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago