Logs Config
Configure Discord webhook logging in ESX Legacy. Webhook names, embed colors, which ESX features log where, and how to log from your own resources.
shared/config/logs.lua configures the Discord webhooks that es_extended uses for logging. It defines named webhooks and named embed colors. ESX.DiscordLog and ESX.DiscordLogFields look up both by name, so your own resources can log through the same config.
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 |
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).
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. |
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
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
ESX.DiscordLogFields("Police", "Player cuffed", "blue", {
{ name = "Officer", value = xPlayer.getName(), inline = true },
{ name = "Suspect", value = xTarget.getName(), inline = true },
})Related
Frequently asked questions
Independent documentation
Last updated on
Adjustments Config
es_extended adjustments.lua explained. Toggle PvP, wanted level, dispatch, NPC density, HUD components, AI plates and Discord Rich Presence in ESX Legacy.
Server Functions
Every ESX.* server function in ESX Legacy 1.16.4 with signatures, parameters, return values and examples. Players, callbacks, commands, jobs, items and vehicles.