Draft
Conversation
Agent-Logs-Url: https://github.com/fivemanage/sdk/sessions/4ff3773a-13c6-4eb9-8ef9-876b365f996d Co-authored-by: itschip <59088889+itschip@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add ESX world logging integration for resource events
Add ESX world logging integration
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new third-party logging integration that automatically captures and forwards structured logs to Fivemanage from six common ESX civilian/world resources.
Changes
features/logs/server/third-party/esx-world.ts— New file listening to 12onNetevents acrossesx_garage,esx_property,esx_drugs,esx_license,esx_identity, andesx_ambulancejob. Each handler resolves player names viaGetPlayerName(), constructs rich metadata, and callsingest()with_internal_RESOURCEset to the originating resource.config.json— AddsesxWorldEvents: { enabled: false, dataset: "default" }underlogs.config.schema.json— Adds schema definition and adds"esxWorldEvents"to therequiredarray.features/utils/common/config.ts— AddsesxWorldEvents: EventConfigSchematoConfigSchemafor startup validation.features/logs/server/logger.ts— Addsimport './third-party/esx-world'alongside existing third-party imports.Example
Integration is opt-in (
enabled: falseby default) and follows the same pattern as the existingox-inventoryintegration.Original prompt
Add ESX World Logging Integration
Add a new third-party logging integration for ESX world/civilian resources (
esx_garage,esx_property,esx_drugs,esx_license,esx_identity,esx_ambulancejob) that automatically sends structured logs to Fivemanage.Background
The SDK already has a pattern for third-party integrations (see
features/logs/server/third-party/ox-inventory.ts). We need to follow the same pattern exactly: create a new file, gate it behind a config flag, and import it inlogger.ts.What to implement
1. Create
features/logs/server/third-party/esx-world.tsListen to the following events using
onNet():esx_garage:
esx_garage:takeOutVehicle— args:(playerId: number, plate: string, model: string)— message:player ${playerName} took out vehicle ${model} (${plate}) from garage, metadata:{ playerSource, playerName, vehiclePlate: plate, vehicleModel: model, action: "takeOut" }, resource:"esx_garage"esx_garage:storeVehicle— args:(playerId: number, plate: string, model: string)— message:player ${playerName} stored vehicle ${model} (${plate}) in garage, metadata:{ playerSource, playerName, vehiclePlate: plate, vehicleModel: model, action: "store" }, resource:"esx_garage"esx_property:
esx_property:buy— args:(playerId: number, propertyName: string, price: number)— message:player ${playerName} bought property ${propertyName} for $${price}, metadata:{ playerSource, playerName, propertyName, price }, resource:"esx_property"esx_property:enter— args:(playerId: number, propertyName: string)— message:player ${playerName} entered property ${propertyName}, metadata:{ playerSource, playerName, propertyName, action: "enter" }, resource:"esx_property"esx_property:exit— args:(playerId: number, propertyName: string)— message:player ${playerName} exited property ${propertyName}, metadata:{ playerSource, playerName, propertyName, action: "exit" }, resource:"esx_property"esx_drugs:
esx_drugs:harvestPlants— args:(playerId: number, plantType: string, amount: number)— message:player ${playerName} harvested ${amount}x ${plantType}, metadata:{ playerSource, playerName, plantType, amount, action: "harvest" }, resource:"esx_drugs"esx_drugs:processDrugs— args:(playerId: number, drugType: string, amount: number)— message:player ${playerName} processed ${amount}x ${drugType}, metadata:{ playerSource, playerName, drugType, amount, action: "process" }, resource:"esx_drugs"esx_license:
esx_license:addLicense— args:(playerId: number, licenseType: string)— message:player ${playerName} granted license ${licenseType}, metadata:{ playerSource, playerName, licenseType, action: "add" }, resource:"esx_license"esx_license:removeLicense— args:(playerId: number, licenseType: string)— message:player ${playerName} had license ${licenseType} revoked, metadata:{ playerSource, playerName, licenseType, action: "remove" }, resource:"esx_license"esx_identity:
esx_identity:registrationDone— args:(playerId: number, firstName: string, lastName: string, dateOfBirth: string, sex: string, height: number)— message:player ${playerName} completed character registration, metadata:{ playerSource, playerName, firstName, lastName, dateOfBirth, sex, height }, resource:"esx_identity"esx_ambulancejob:
esx_ambulancejob:revive— args:(targetId: number, medicId: number)— message:player ${targetName} revived by ${medicName}, metadata:{ targetSource: targetId, targetName, playerSource: medicId, playerName: medicName }, resource:"esx_ambulancejob"esx_ambulancejob:onPlayerDead— args:(playerId: number)— message:player ${playerName} declared dead, metadata:{ playerSource, playerName }, resource:"esx_ambulancejob"All events should:
onNet(...)to listenGetPlayerName(id.toString())to resolve player names where applicable{ _internal_RESOURCE: "<resource-name>" }as the last_internalOptsargument toingest()if (config.logs.esxWorldEvents?.enabled)config.logs.esxWorldEvents.datasetas the dataset2. Update
config.jsonAdd inside
"logs":3. Update
config.schema.jsonAdd the schema entry for
esxWorldEventsfollowing the exact same structure as existing entries: