Draft
Conversation
Agent-Logs-Url: https://github.com/fivemanage/sdk/sessions/b355eb61-c729-46dc-893f-c51c364ab96a Co-authored-by: itschip <59088889+itschip@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add ESX core logging integration for player events
Add ESX Core (es_extended) 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 for
es_extended(ESX Legacy core), following the existing pattern established byox-inventory.ts. When enabled, the SDK listens to core ESX server events and ships structured logs with rich metadata to Fivemanage.New file:
features/logs/server/third-party/esx-core.tsCovers 8 ESX core events across four categories, all gated by
config.logs.esxCoreEvents?.enabled:esx:playerLoaded,esx:playerSpawnedesx:setJob(includes new job + previous job metadata)esx:addInventoryItem,esx:removeInventoryItem(built-in esx_inventory only, not ox_inventory)esx:addAccountMoney,esx:removeAccountMoney,esx:setAccountMoneyAll events pass
{ _internal_RESOURCE: "es_extended" }and resolve player names viaGetPlayerName.Config changes
config.json— new section, disabled by default:config.schema.json— schema entry added,"esxCoreEvents"added torequiredarray.features/utils/common/config.ts—esxCoreEvents: EventConfigSchemaadded toConfigSchema.Wired up in
logger.tsOriginal prompt
Add ESX Core (es_extended) Logging Integration
Add a new third-party logging integration for
es_extended(ESX Legacy core) that automatically sends structured logs to Fivemanage when core ESX player events fire.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-core.tsListen to the following
es_extendedserver events and log them usingingest()from../logger:Player lifecycle:
esx:playerLoaded— args:(playerId: number, xPlayer: { job?: unknown, accounts?: unknown, identifier?: string })— log message:player ${playerName} loaded, metadata:{ playerSource, playerName, job, identifier }esx:playerSpawned— args:(playerId: number)— log message:player ${playerName} spawned, metadata:{ playerSource, playerName }Job changes:
esx:setJob— args:(playerId: number, job: { name: string, label: string, grade: number, grade_label: string }, lastJob: { name: string, label: string, grade: number })— log message:player ${playerName} job changed to ${job.name}, metadata:{ playerSource, playerName, job: { name, label, grade, gradeLabel }, previousJob: { name, label, grade } }Inventory changes (built-in esx_inventory, NOT ox_inventory):
esx:addInventoryItem— args:(playerId: number, itemName: string, itemCount: number)— log message:player ${playerName} received item ${itemName} x${itemCount}, metadata:{ playerSource, playerName, itemName, itemCount, action: "add" }esx:removeInventoryItem— args:(playerId: number, itemName: string, itemCount: number)— log message:player ${playerName} lost item ${itemName} x${itemCount}, metadata:{ playerSource, playerName, itemName, itemCount, action: "remove" }Account money changes:
esx:addAccountMoney— args:(playerId: number, accountName: string, money: number)— log message:player ${playerName} received $${money} in account ${accountName}, metadata:{ playerSource, playerName, accountName, amount: money, action: "add" }esx:removeAccountMoney— args:(playerId: number, accountName: string, money: number)— log message:player ${playerName} lost $${money} from account ${accountName}, metadata:{ playerSource, playerName, accountName, amount: money, action: "remove" }esx:setAccountMoney— args:(playerId: number, accountName: string, money: number)— log message:player ${playerName} account ${accountName} set to $${money}, metadata:{ playerSource, playerName, accountName, amount: money, action: "set" }All events should:
onNet(...)to listenGetPlayerName(playerId.toString())to resolve the name{ _internal_RESOURCE: "es_extended" }as the last_internalOptsargument toingest()if (config.logs.esxCoreEvents?.enabled)config.logs.esxCoreEvents.datasetas the dataset2. Update
config.jsonAdd the new config section inside
"logs":3. Update
config.schema.jsonAdd the schema entry for
esxCoreEventsfollowing the exact same structure as the existing entries likeoxInventoryEvents:Also add
"esxCoreEvents"to therequiredarray.4. Update
features/logs/server/logger.tsAdd the import at the bottom of the existing third-party imports block:
Reference files
features/logs/server/third-party/ox-inventory.tsconfig.jsonandconfig.schema.jsonfeatures/logs/server/logger.ts(add at line ~22 with the other third-party imports)The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Look through the different esx resources in https://github.com/orgs/esx-framework/repositories, including esx_core + legacy addons, and figure out what we can automate in fivemanage/sdk and sends logs directly to Fivemanage from the Fivemanage SDK, by listening to events and other triggers.
We need the logs to have simple log messages and be rich in metadata to make it easy to search for the logs and create dashboards later.
Assistant: Now let m...
This pull request was created from Copilot chat.