# Discord Log

## Step 1: Configure the Discord Log System

**Locate the `server/discord_log.lua` File**

* Navigate to the `server` folder within your script files.
* Find and open the `discord_log.lua` file.

## Step 2: Enable Logging and Set Webhook

Inside the `discord_log.lua` file, you'll find a section that manages the log settings. To enable the log system and set your Discord webhook, follow these steps:

* Locate the following block of code in the file:

```lua
discordLog = {
    enabled = false,
    webhook = 'https://discord.com/api/webhooks/1273230382594003019/FqPU9b0FqkROTKOgKoLThb5ApA-vV14JbuFwOPAUsDJrJqYHTwwFAHUlnvz8IwJZh7UE',
}
```

* To activate the log system, set the `enabled` field to `true`:

```lua
enabled = true
```

* Replace the existing webhook URL with your own Discord webhook. This is where the logs will be sent. You can create a new webhook in the settings of your Discord server:

```lua
webhook = 'https://discord.com/api/webhooks/YOUR_WEBHOOK_URL'
```

#### Example of Updated Configuration:

After making these changes, your code should look like this:

```lua
discordLog = {
    enabled = true,  -- Enable the logging system
    webhook = 'https://discord.com/api/webhooks/YOUR_WEBHOOK_URL',  -- Replace with your Discord webhook
}
```

## Step 3: Save and Restart Your Server

* After updating the webhook and enabling the log system, save the changes to the `discord_log.lua` file.
* Restart your FiveM server to apply the new log settings.

***

By following these steps, you will successfully enable the Discord log system and ensure that all logs are sent to your specified Discord channel via the provided webhook.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rainmad.com/resources/chopshop-with-welding-minigame/discord-log.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
