1.2.0 • Published 18 days ago

pm2-ban-logger v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
18 days ago

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

  1. Create a Discord Webhook for your server. See this article for more information.
  2. Set your PM2 config values
  3. 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
  1. You can set the same or different webhook for each channel but logs will not be recorded if the webhook is not set.

Development

  1. Fork and clone the repo
  2. Install dependencies
  yarn install
  1. Build the project in watch mode
  yarn watch
  1. Copy the package.json file into the dist folder
  cp package.json dist
  1. Run the project locally in PM2
  cd dist
  pm2 install .
1.2.0

18 days ago

1.1.1

25 days ago

1.1.0

25 days ago

1.0.2

25 days ago

1.0.1

25 days ago

1.0.0

25 days ago