Kifflom Log is a logging plugin for FiveM servers that integrates with Grafana Loki. It automatically captures and logs network events and export calls from your server resources, providing detailed insights for debugging and monitoring.
- Event Tracking: Automatically logs all network events triggered across your server
- Export Call Monitoring: Tracks all server-side export function calls between resources
- Grafana Loki Integration: Send logs to Grafana Loki for advanced querying and visualization
- Detailed Context: Captures source player ID, citizen ID (Qbox), invoking resource, and arguments
- FiveM server with Node.js 22 support
- Grafana Loki instance
-
Clone the repository into your FiveM server resources folder:
cd resources git clone https://github.com/lordchunk/kifflom_log -
Navigate to the project directory:
cd kifflom_log -
Install dependencies:
npm install
-
Build the project:
npm run build
-
Add the resource to your
server.cfgconfiguration. Kifflom Log should be started before any other resources that you want to log:# Kifflom Log Configuration set kifflom:log:grafana_token "YOUR_GRAFANA_TOKEN" set kifflom:log:grafana_url "YOUR_GRAFANA_LOKI_URL" ensure kifflom_log ... start other resources -
To enable logging for your resource, add the following to the start of your
fxmanifest.lua:server_scripts { '@kifflom_log/init-server.lua', ... }
Kifflom Log works by monkey-patching the FiveM server's event handling system:
- It intercepts all event registrations and wraps callbacks in logging functionality
- It captures export function calls across resources
- All logs are sent to your configured Grafana Loki instance
- For events from player sources, it attempts to retrieve the citizen ID if Qbox Core is used
Adding this line will automatically enable the capturing of all network events and export calls in your resource without any additional code changes.
Any event triggered on your server will be automatically captured with useful metadata:
-- This event will be automatically logged with source and arguments
RegisterNetEvent('my-resource:someAction', function(data)
-- Your code here
end)Export calls between resources are automatically logged:
-- This export call will be logged with all arguments
exports['some-resource']:someFunction('arg1', 'arg2')Access your logs through your Grafana Loki interface. You can query logs using LogQL with labels like:
{level="error"}- Show only error logs{event="playerConnecting"}- Show logs for specific events{citizen_id="ABC123"}- Filter logs by player citizen ID{invoking_resource="my-resource"}- Show logs from a specific resource