A Bunyan stream for emailing logs using the Mailgun api.
npm install bunyan-mailgun
By default BunyanMailgun will create a dynamic email including the subject and email body derived from the bunyan log.
var Bunyan = require('bunyan'),
BunyanMailgun = require('bunyan-mailgun')
var logger = Bunyan.createLogger({
name: 'test',
streams: [{
type: 'raw',
level: 'fatal',
stream: new BunyanMailgun({
to: '[email protected]',
from: '[email protected]',
key: 'key-XXXXXXXXXXXXXXXXXXXXXXX', // Mailgun API key
domain: 'mydomain.mailgun.org' // Your Mailgun Domain
})
}]
})
logger.fatal(new Error('Oh noze!'), 'Bad happened')
npm test
BunyanMailgun was essentially created for fatal level logs. Any other levels would eat up your Mailgun account message allotment.
The author or contributors of this software are NOT IN ANYWAY responsible for any charges or damages made by sending emails through the Mailgun service. In otherwords only send fatals. And watch them closely.