Bunyan Stream Email
About
A stream interface that sends email with each write through common
nodemailer
transporters
and is meant to be
used with the NodeJS logger bunyan
.
Currently, the log record will simply be emailed as pretty-printed JSON text; however, in the future, the log messages will be formatted.
Example
'use strict';const BunyanStreamEmail = ;const nodemailer = ;const bunyan = ;const sendmailTransport = ; // Create transporter (could be any number of the nodemailer transporters)const transporter = nodemailer; // Create a streamconst emailStream = sender: 'sender@example.com' recipient: 'admin@example.com' transporter; // Create the logger and register the streamconst log = bunyan; // Trigger some logs! Our email stream will be written to for log events meeting// the set level filterlog;log;