winston-buffer-mail
v1.0.1
Published
Winston log mail based on nodemailer. Also useful to buffers errors and send them in one email.
Downloads
3
Maintainers
Readme
winston-buffer-mail
A winston mail library for buffer the error logs and send to email based on mailer for winston.
Installation
$ npm install winston
$ npm install winston-buffer-mail
Usage
var winston = require('winston');
//
// Requiring `winston-buffer-mail` will expose
// `winston.transports.Mail`
//
require('winston-buffer-mail').Mail;
winston.add(winston.transports.Mail, options);
The Mail transport uses nodemailer behind the scenes. Options are the following:
- to: The address(es) you want to send to. [required]
- from: The 'from' address (default:
winston@[server-host-name].com
) - subject: Email subject
- host: SMTP server hostname (default: localhost)
- port: SMTP port (default: 587 or 25)
- service: SMTP service (default: gmail)
- username User for server auth [required]
- password Password for server auth [required]
- level: Level of messages that this transport should log.
- silent: Boolean flag indicating whether to suppress output.
- prefix: String for using in as prefix in the subject.
- maxBufferItems Max errors that will be buffered (default 100)
- maxBufferTimeSpan Max miliseconds errors will be buffered (default 60000)