> For the complete documentation index, see [llms.txt](https://fb-scripts.gitbook.io/fb-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fb-scripts.gitbook.io/fb-scripts/scripts/fb-blackmarket/discord-logging.md).

# Discord Logging

#### Setup

{% stepper %}
{% step %}
Create a Discord webhook in your server channel
{% endstep %}

{% step %}
Open `server/log-config.lua`
{% endstep %}

{% step %}
Paste your webhook URL:

```lua
DiscordConfig.Webhook = "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN"
DiscordConfig.BotName = "Black Market Bot"
DiscordConfig.Enabled = true
DiscordConfig.Debug = false
```

{% endstep %}
{% endstepper %}

#### What Gets Logged

| Event               | Color         | Information                          |
| ------------------- | ------------- | ------------------------------------ |
| **Purchase**        | 🟢 Green      | Player, items, price, payment method |
| **Level Up**        | 🔴 Red        | Player name, new level               |
| **Task Completion** | 🔵 Blue       | Player, task name, XP reward         |
| **Security Alerts** | 🟡 Yellow/Red | Violations, rate limit breaches      |

#### Test Logging

From server console:

```
fbs_testlog
```

***
