A Discord webhook is a secret link that lets your server post messages in one channel, without a bot. Below you read what txAdmin already logs, where your framework keeps its webhooks and how to write a small log script yourself.
Need a server? Our FiveM server hosting starts at €5 a month, with txAdmin ready to go. You can also try one free for 24 hours.
What txAdmin already logs
Open txAdmin with Tx Admin at the top of your server page. Server Log shows joins, leaves, deaths, chat messages, explosions and commands. System, Action Log shows bans, warnings, restarts, changed settings and everything typed in the Live Console. So to look something up, you don't need a webhook.
The txAdmin Discord bot posts in the channel under Warnings Channel ID when your server starts, restarts or stops, before a scheduled restart and for announcements. It doesn't post bans or kicks: for those you use a webhook.
Creating a webhook
- Create a log channel that only your staff can see.
- In Discord, open Server Settings, go to Integrations and click Create Webhook, or New Webhook if you already have one.
- Give the webhook a name, choose the log channel and save.
- Click Copy Webhook URL.
Keep the URL secret
With the URL, anyone can post in your channel without logging in, and edit or delete the webhook's messages.
- Never put it in a client script, a shared file or a line with
setrorsets: players can read those, andsetseven shows up in the server list. - Put it in your server.cfg with
set, or in a configuration file that only the server loads. - Don't share a screenshot of it. Leaked anyway? Delete the webhook in Discord under Integrations and create a new one.
- Don't log IP addresses: you don't need them for moderation, and they are personal data.
Logs in your framework
- ESX Legacy:
es_extended/shared/config/logs.lua.UserActionsgets admin commands such as/setjoband/giveitem,Paycheckthe salaries. Those two only send something once you also setConfig.AdminLogging = trueandConfig.LogPaycheck = trueines_extended/shared/config/main.lua. - QBCore:
qb-smallresources/server/logs.lua, with a webhook per type, such asjoinleave,death,oocandbans. QBCore no longer gets updates for FiveM, see Move your FiveM server from QBCore to Qbox. - Qbox:
qbx_core/config/server.lua, underlogging:joinleave,ooc,anticheatandplayermoney.
Put the URL between the quotes; in Qbox, replace nil with the URL between quotes. Only the server loads these files. Restart after a change.
No framework? The well-known JD_logs is archived on GitHub. Its successor is SilentWatcher by FinnLocked: standalone, and in December 2026 version 1.0.1 is the newest. It logs joins, chat, deaths and explosions, among other things. Set IP = false everywhere in its config/webhooks.lua.
Writing your own log script
- In Files, go to resources, create the folder
discord-logswith Create Directory and add the two files below to it with New file. - In the server.cfg editor, click Manual Edit and add
set discord_webhook "https://discord.com/api/webhooks/..."above theensurelines, with your own URL. Your license key is readable there too, so no screenshots. - Add
discord-logsunder Resources, click Save and restart your server.
fxmanifest.lua:
fx_version 'cerulean'
game 'gta5'
server_script 'server.lua'
server.lua:
local webhook = GetConvar('discord_webhook', '')
local function sendLog(title, text, color)
if webhook == '' then return end
local body = json.encode({
username = 'Server logs',
embeds = { { title = title, description = text, color = color } },
})
PerformHttpRequest(webhook, function(status)
if status ~= 204 then print('Discord log failed: ' .. tostring(status)) end
end, 'POST', body, { ['Content-Type'] = 'application/json' })
end
AddEventHandler('playerJoining', function()
sendLog('Joined', GetPlayerName(source) .. ' (ID ' .. source .. ')', 65280)
end)
AddEventHandler('playerDropped', function(reason)
sendLog('Left', GetPlayerName(source) .. ': ' .. reason, 16711680)
end)
AddEventHandler('txAdmin:events:playerBanned', function(data)
sendLog('Ban', data.targetName .. ' by ' .. data.author .. ': ' .. data.reason, 16711680)
end)
The script posts an embed when someone joins or leaves, and when someone gets a ban in txAdmin. New to Lua? Read Your first FiveM script in Lua.
Nothing arrives in Discord?
- No message and no error in the console? Then the URL is empty. Check that the
set discord_webhookline is in your server.cfg, above theensurelines, and restart your server: the script only reads the URL when it starts. - **
Discord log failed: 404**: the webhook no longer exists. Create a new one and put the new URL in your server.cfg. - **
Discord log failed: 429**: Discord limits how many messages a webhook may send. So don't log every shot, and give busy logs a webhook of their own. - No bans in your channel? The script only sees bans you give in txAdmin, not bans from other scripts.
- ESX doesn't log admin commands? Set
Config.AdminLogging = true, see above.

