Skip to content

YUHAI0/log4js-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LOG4JS Weebhook Appender

The only webhook appenders for log4js

Install

npm install --save log4js-webhook

Usage

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");

config

  • 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]

About

The only webhook appenders for log4js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published