Logs from other scripts
Send the logs your scripts already write into the player log, from scripts that post to Discord and from ox_lib's logger, with no edits to the scripts.
On this page
Most servers already have scripts writing logs somewhere, usually a Discord channel. FiveStaff can take those same logs into the player log, where your staff can search them and see them on each player's profile.
Which way to set it up depends on how the script logs:
| The script… | Use |
|---|---|
| Has a box for a Discord webhook in its config | A log webhook |
| Uses ox_lib's logger | The ox_lib settings |
| Is your own, and you can edit it | One line of Lua |
Whichever you use, the player log has to be switched on.
Scripts that post to Discord#
Nearly every script, escrowed ones included, has somewhere to paste a Discord webhook. Give it a FiveStaff address instead, and what it would have posted to Discord goes into the player log. Log webhooks are part of the Pro plan.
- Open Player log and press Webhooks.
- Under Make a webhook, name it after the script (such as
qs-inventory), choose the category its logs belong in, and press Make webhook. - Press Copy address.
- Paste it into the script's config where it asks for a Discord webhook, in place of the Discord one.
- Restart the script. Its next log shows in the player log under the webhook's name.
Messages, embeds and their fields, the newer Discord layouts, polls and plain text are all read. Pictures and files are not kept, only their names. A log that names a player by their licence, Discord, Steam or FiveM id is filed under that player.
A few scripts refuse any address that is not Discord's. Those cannot use a webhook.
Scripts that use ox_lib#
ox_lib, the library most Overextended and ox scripts are built on, has a logger many scripts use. It can only send to the services it already knows, so it is pointed at FiveStaff through its Loki setting. You do not need a Loki server: FiveStaff takes the logs itself.
-
Open Player log and press Webhooks.
-
Make one webhook for all of your ox_lib scripts, named
ox_lib, and press Copy address. -
Add these two lines to your
server.cfg, with the address you copied:set ox:logger "loki" set loki:endpoint "https://panel.fivestaff.gg/api/webhooks/…" -
On ox_lib 3.42 or newer, also download loki.lua and put it in ox_lib's
resource/loggerfolder, next tofivemanage.lua. See why below. -
Restart the server.
From then on, every log an ox_lib script writes goes into the player log, with no change to the scripts themselves. Each log is filed under the player it was about, and keeps the script it came from, the kind of event and everything else the script sent with it.
The extra file on newer ox_lib#
ox_lib 3.42 added a second logger, which some newer scripts use. It reads the same ox:logger setting, but ox_lib does not include a Loki option for it. Without the file, ox_lib prints this in the server console when it starts, and that logger's logs go nowhere:
module 'resource.logger.loki' not found
loki.lua is that missing option. It uses the same loki:endpoint you set above, so both of ox_lib's loggers send to FiveStaff.
Not using ox_lib 3.42 yet?#
On an older ox_lib, the two server.cfg lines are all you need. The file does nothing there, so it is safe to add it anyway, ready for when you update.
If nothing arrives#
Open Player log and press Webhooks. A webhook that has not been used yet says Not used yet, and one whose logs are not being kept says Storing nothing, with the reason underneath.
| What you see | What to do |
|---|---|
| Not used yet, and nothing in the server console | Check the address was pasted in full, then restart the script or the server |
unable to submit logs or Failed to submit logs with 401 in the server console |
The address is out of date. Copy it again from the Webhooks screen. Pressing New address stops the old one working |
| The same, with 403 | The server is no longer on Pro. Its webhooks are paused until it is on Pro again |
| The same, with 429 | The script is sending faster than one webhook takes. Give its logs a webhook of their own |
| Storing nothing, the player log is switched off | Switch it on |
| Storing nothing, a category is switched off | Turn the category back on in the player log's settings, or edit the webhook and choose another |
Permissions#
Making, changing and removing webhooks needs Choose what is logged, and clear logs. Reading what they send needs View the player log, the same as the rest of the player log.