pm2-ban-logger
v1.2.0
Published
PM2 Ban Logger
Downloads
6
Readme
pm2-ban-logger
PM2 Module for logging events & logs from your PM2 processes to Discord via webhooks. This module is designed to be used with PM2, it is not a standalone application.
Install
To install and setup pm2-ban-logger, run the following commands:
pm2 install pm2-ban-logger
Config Properties
interface Config {
/**
* Duration in seconds to aggregate messages.
* @default 1
* */
buffer_seconds?: number
/**
* Duration in seconds to aggregate stats.
* @default 15
* */
stats_minutes?: number
/**
* Discord webhook url for logs
* @default null
* */
log_url: string | null
/**
* Discord webhook url for stats embeds
* @default null
*/
stats_url: string | null
}
Setup
- Create a Discord Webhook for your server. See this article for more information.
- Set your PM2 config values
- e.g:
pm2 set pm2-ban-logger:buffer_seconds 1
pm2 set pm2-ban-logger:log_url https://discordapp.com/api/webhooks/123456789/abcdefghijklmnopqrstuvwxyz
pm2 set pm2-ban-logger:stats_minutes 15
pm2 set pm2-ban-logger:stats_url https://discordapp.com/api/webhooks/123456789/abcdefghijklmnopqrstuvwxyz
- You can set the same or different webhook for each channel but logs will not be recorded if the webhook is not set.
Development
- Fork and clone the repo
- Install dependencies
yarn install
- Build the project in watch mode
yarn watch
- Copy the
package.json
file into thedist
folder
cp package.json dist
- Run the project locally in PM2
cd dist
pm2 install .