bunyan-nodemailer

0.0.1 • Public • Published

bunyan-nodemailer

A Bunyan stream for emailing logs using the nodemailer api.

Install

npm install bunyan-nodemailer

Emails

By default BunyanMailgun will create a dynamic email including the subject and email body derived from the bunyan log.

Example

var Bunyan = require('bunyan'),
    BunyanMailgun = require('bunyan-nodemailer')

var logger = Bunyan.createLogger({
    name: 'test',
    streams: [{
        type: 'raw',
        level: 'fatal',
        stream: new BunyanNodeMailer({
            to: 'to@example.com',
            from: 'from@example.com',
            transport: {
                host:'smtp.mail.com',
                port: 587,
                secure: true,
                auth: {
                    user: 'abc',
                    pass: 'abcabc'
                }
            }
        })
    }]
})

logger.fatal(new Error('Oh noze!'), 'Bad happened')

Test

npm test

Damage and Liability

BunyanNodeMailer was essentially created for fatal level logs. Any other levels would eat up your SMTP account message allotment if using a relay service.

The author or contributors of this software are NOT IN ANYWAY responsible for any charges or damages made by sending emails through the SMTP relay services. In otherwords only send fatals. And watch them closely.

Dependents (0)

Package Sidebar

Install

npm i bunyan-nodemailer

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • elseblock