Skip to content

renorari/log4js-discord

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 message
  • username - string - the username to display with the message
  • layout - object (optional, defaults to basicLayout) - 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.

About

Discord Appender for log4js-node

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%