The only webhook appenders for log4js
npm install --save log4js-webhook
var log4js = require('log4js');
log4js.configure({
appenders: {
mycat: {
type: "log4js-webhook",
webhook_url: "http://webhook",
converter: (ctx) => {
return {
text: ctx.formatString()
};
}
}
},
categories: { default: { appenders: ["mycat"], level: "debug" } },
});
const logger = log4js.getLogger('test');
logger.info("hello log4js-webhook");
- webhook_url: the webhook url to send, no default, must config one.
- converter: custom logging event converter for customizing your data
Developed by [email protected]