Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/log4js-node/mailgun
Mailgun Appender for Log4JS
https://github.com/log4js-node/mailgun
Last synced: about 1 month ago
JSON representation
Mailgun Appender for Log4JS
- Host: GitHub
- URL: https://github.com/log4js-node/mailgun
- Owner: log4js-node
- License: apache-2.0
- Created: 2018-03-05T20:51:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-21T01:38:39.000Z (over 1 year ago)
- Last Synced: 2024-04-25T21:20:45.308Z (9 months ago)
- Language: JavaScript
- Size: 741 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mailgun Appender for Log4JS
This is an optional appender for [log4js-node](https://log4js-node.github.io/log4js-node/).
```bash
npm install @log4js-node/mailgun
```This appender uses the [mailgun](https://www.mailgun.com) service to send log messages as emails. It uses the [mailgun-js](https://www.npmjs.com/package/mailgun-js) package.
## Configuration
* `type` - `@log4js-node/mailgun`
* `apiKey` - `string` - your mailgun API key
* `domain` - `string` - your domain
* `from` - `string`
* `to` - `string`
* `subject` - `string`
* `layout` - `object` (optional, defaults to basicLayout) - see [layouts](layouts.md)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.
## Example
```javascript
log4js.configure({
appenders: {
type: '@log4js-node/mailgun',
apiKey: '123456abc',
domain: 'some.company',
from: '[email protected]',
to: '[email protected]',
subject: 'Error: Developers Need To Be Fired'
}
});
```