# Logs Config (/docs/es_extended/config/logs)

`shared/config/logs.lua` configures the Discord webhooks that es_extended uses for logging. It defines named webhooks and named embed colors. [`ESX.DiscordLog`](/docs/es_extended/server/functions#discordlog) and [`ESX.DiscordLogFields`](/docs/es_extended/server/functions#discordlogfields) look up both by name, so your own resources can log through the same config.

## Overview [#overview]

| Fact | Value |
| --- | --- |
| File | `es_extended/shared/config/logs.lua` |
| Loaded as | Server script only (despite the `shared` folder) |
| Table | `Config.DiscordLogs` with `Webhooks` and `Colors` |
| Used by | `ESX.DiscordLog`, `ESX.DiscordLogFields`, admin commands, paychecks |

<Callout type="warn">
Discord webhooks are rate limited and requests can fail silently. ESX sends them without retries. Use them for low-volume staff notices; for a busy server, consider a real logging pipeline (for example Grafana Loki or Datadog).
</Callout>

## Webhooks [#webhooks]

`Config.DiscordLogs.Webhooks` maps a log name to a webhook URL. An empty string disables that channel. Unknown names fall back to `default`.

| Key | Used by |
| --- | --- |
| `default` | Fallback for every name without its own webhook. |
| `test` | Free for testing. |
| `Chat` | Free for chat logging resources. |
| `UserActions` | Admin commands when `Config.AdminLogging = true` (`/car`, `/setjob`, `/giveitem`, `/setgroup`, ...). |
| `Resources` | Free for resource start and stop logging. |
| `Paycheck` | Paychecks when `Config.LogPaycheck = true`. |

```lua title="shared/config/logs.lua"
Config.DiscordLogs = {
    Webhooks = {
        default = "https://discord.com/api/webhooks/...",
        test = "",
        Chat = "",
        UserActions = "https://discord.com/api/webhooks/...",
        Resources = "",
        Paycheck = "",
        Police = "https://discord.com/api/webhooks/...", -- custom channel
    },
    Colors = {
        -- ...
    },
}
```

## Colors [#colors]

`Config.DiscordLogs.Colors` maps a color name to a decimal color value. Unknown names fall back to `default`.

| Key | Value |
| --- | --- |
| `default` | `14423100` |
| `blue` | `255` |
| `red` | `16711680` |
| `green` | `65280` |
| `white` | `16777215` |
| `black` | `0` |
| `orange` | `16744192` |
| `yellow` | `16776960` |
| `pink` | `16761035` |
| `lightgreen` | `65309` |

To add a color, convert the hex value to decimal (for example `#5865F2` is `5793266`) and add a key.

## Logging from your resource [#logging-from-your-resource]

```lua title="server/main.lua"
ESX.DiscordLogFields("Police", "Player cuffed", "blue", {
    { name = "Officer", value = xPlayer.getName(), inline = true },
    { name = "Suspect", value = xTarget.getName(), inline = true },
})
```

## Related [#related]

- [Main config](/docs/es_extended/config)
- [Server functions](/docs/es_extended/server/functions)
- [Commands](/docs/es_extended/commands)
