FiveM Docs
es_extendedConfig

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

FactValue
Filees_extended/shared/config/logs.lua
Loaded asServer script only (despite the shared folder)
TableConfig.DiscordLogs with Webhooks and Colors
Used byESX.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.

KeyUsed by
defaultFallback for every name without its own webhook.
testFree for testing.
ChatFree for chat logging resources.
UserActionsAdmin commands when Config.AdminLogging = true (/car, /setjob, /giveitem, /setgroup, ...).
ResourcesFree for resource start and stop logging.
PaycheckPaychecks when Config.LogPaycheck = true.
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

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

KeyValue
default14423100
blue255
red16711680
green65280
white16777215
black0
orange16744192
yellow16776960
pink16761035
lightgreen65309

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

Logging from your resource

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

Frequently asked questions

Independent documentation

esx-fivem.com is a community project and is not affiliated with the ESX Framework team. Facts on this page were checked against the upstream source. Official resources: docs.esx-framework.org and github.com/esx-framework.
Edit on GitHub

Last updated on

On this page