Skip to content
An email transport layer for winston that uses nodemailer
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore specify options for nodemailer Feb 23, 2013
.travis.yml try quoting 0.10 Mar 11, 2013
README.md
index.js Add {{env}} as an option for subject templates Mar 24, 2014
package.json

README.md

Winston NodeMailer Build Status Dependency Status

is a transport for Winston that uses NodeMailer to send mails for log events. Contrary to other solution Winston NodeMailer requires you to provide a valid NodeMailer transport. It's in your hand how to configure your desired transport and to inject it into this module.

Installation

npm install winston-nodemailer

You can either invoke it via winston.Transports.NodeMailer like this:

var winston = require("winston");
require("winston-nodemailer");

winston.add(winston.Transports.NodeMailer, options);

or with a local variable that Winston NodeMailer exports:

var winston = require("winston");
var winstonNodeMailer = require("winston-nodemailer");

winston.add(winstonNodeMailer, options);

Options

to
The address(es) you want to send to. [required]
from
The address you want to send from. (default: winston@[server-host-name])
subject
Subject for email (default: winston: {{level}} {{msg}})
level
Level of messages that this transport should log.
silent
Boolean flag indicating whether to suppress output.
transport
A NodeMailer transport e.g. smtpTransport [required]
Something went wrong with that request. Please try again.