This is an optional appender for log4js-node.
npm install @log4js-node/mailgunThis appender uses the mailgun service to send log messages as emails. It uses the mailgun-js package.
type-@log4js-node/mailgunapiKey-string- your mailgun API keydomain-string- your domainfrom-stringto-stringsubject-stringlayout-object(optional, defaults to basicLayout) - see layouts
The body of the email will be the result of applying the layout to the log event. Refer to the mailgun docs for how to obtain your API key.
log4js.configure({
appenders: {
type: '@log4js-node/mailgun',
apiKey: '123456abc',
domain: 'some.company',
from: 'logging@some.service',
to: 'important.bosses@some.company',
subject: 'Error: Developers Need To Be Fired'
}
});