log4js-discord
v1.0.2
Published
Discord Appender for log4js-node
Downloads
10
Readme
Discord Appender for log4js-node
Sends log events to a Discord channel. This is an optional appender for use with log4js.
npm install log4js-discord
Configuration
type
-log4js-discord
url
-string
-your Discord Webhook URL (see the discord docs)icon_url
-string
(optional) - the icon to use for the messageusername
-string
- the username to display with the messagelayout
-object
(optional, defaults tobasicLayout
) - the layout to use for the message (see layouts).
Example
log4js.configure({
appenders: {
alerts: {
type: 'log4js-discord',
url: 'https://discord.com/api/webhooks/...',
username: 'our_application'
}
},
categories: {
default: { appenders: ['alerts'], level: 'error' }
}
});
This configuration will send all error (and above) messages, with the username our_application
.