Logging
Structured logs, searchable when the next incident hits
Console scrollback disappears on restart. Flat log files drown in noise. FiveGateway captures structured log events from your FiveM resources with typed fields, categories, and Discord routing, so you can answer 'what happened before the crash' without SSH.
Every log entry in FiveGateway has more structure than a one-line console print. You send an event from any resource with a category name, a severity, and a set of typed fields: player identifier, vehicle model, item SKU, whatever matters for that event. The dashboard indexes those fields, so 'show me every vehicle spawn by license:abc123 in the last 24 hours' is a single filter, not a grep pipeline.
Categories are the unit of routing. You define them in the dashboard, assign a field schema, and wire a webhook. A store-purchase category can push to your sales Discord channel, a fail2ban category to moderation, and a crash category to both Discord and a custom Slack endpoint. Because categories are configured once and reused, your resource code stays short: emit the event, the dashboard handles where it goes and who sees it.
History is where structured logs earn their keep. After a griefer gets banned, you pull up the player profile, filter their log entries by category, and have the whole sequence: when they joined, what they spawned, what chat they sent, when the warn fired, and when the ban landed. The same works at the server level. Filter to errors in the last hour after a restart and see the real cause, not the 800 debug lines around it.
Because logs are typed, they are exportable. Any filtered view becomes a CSV download that product, community, or compliance teams can work with outside the tool. You can also pipe the same events through a category-level webhook to your own analytics stack if you need long-term storage beyond your plan's retention window.
If you are building a new integration, start with the Lua snippet in the dashboard setup guide. It ships a single FiveGateway.Log function that accepts a category, severity, and metadata table. Drop it into any existing resource without refactoring your script layout.
Server admins that have used plain console prints or file writes will recognize the shift quickly. Instead of writing a log, forgetting about it, and grepping when something breaks, you are writing a queryable event with an intent: this category, this severity, this player. The typical result is faster incident reviews, better audit trails for donation disputes, and moderation decisions that survive appeals because you can show your work.
How it works
- 1
Define categories
Create a log category in the dashboard, pick the field types, and optionally attach a Discord or custom webhook URL.
- 2
Emit events from Lua
Use the FiveGateway.Log function in your resources. Pass the category, severity, and a typed metadata table. The call is async and non-blocking.
- 3
Search, filter, export
Open the logs view, filter by category, player, severity, or time range, and export the results as CSV for offline review.