Draft
Conversation
Agent-Logs-Url: https://github.com/fivemanage/sdk/sessions/fb48ac20-a7d3-47ce-bce3-2e077430b77a Co-authored-by: itschip <59088889+itschip@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add ESX police job logging integration
feat: Add esx_policejob 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 log integration for
esx_policejob, following the same pattern as the existingox-inventoryintegration.Changes
features/logs/server/third-party/esx-policejob.ts— New file; listens viaonNetto threeesx_policejobserver events and ingests structured logs with player/officer metadata:esx_policejob:jailPlayer— logs jail duration, target, and officeresx_policejob:handcuffed— logs target and officeresx_policejob:seizeWeapons— logs target, officer, and weapons arrayconfig.json— AddsesxPoliceEvents: { enabled: false, dataset: "default" }underlogsconfig.schema.json— AddsesxPoliceEventsschema entry withenabled/datasetproperties; adds torequiredarrayfeatures/utils/common/config.ts— AddsesxPoliceEvents: EventConfigSchemato the valibot config schemafeatures/logs/server/logger.ts— Addsimport './third-party/esx-policejob'Example log output
Integration is disabled by default and gated by
config.logs.esxPoliceEvents?.enabled.Original prompt
Add ESX Police Job Logging Integration
Add a new third-party logging integration for
esx_policejob(ESX Legacy Addons) that automatically sends structured logs to Fivemanage when police job 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-policejob.tsListen to the following
esx_policejobserver events usingonNet():esx_policejob:jailPlayer— args:(targetId: number, time: number, officerId: number)— log message:player ${targetName} jailed for ${time} minutes by ${officerName}, metadata:{ targetSource: targetId, targetName, playerSource: officerId, playerName: officerName, jailTime: time }esx_policejob:handcuffed— args:(targetId: number, officerId: number)— log message:player ${targetName} handcuffed by officer ${officerName}, metadata:{ targetSource: targetId, targetName, playerSource: officerId, playerName: officerName }esx_policejob:seizeWeapons— args:(targetId: number, officerId: number, weapons: unknown[])— log message:weapons seized from ${targetName} by officer ${officerName}, metadata:{ targetSource: targetId, targetName, playerSource: officerId, playerName: officerName, weapons }All events should:
onNet(...)to listenGetPlayerName(id.toString())to resolve names for both officer and target{ _internal_RESOURCE: "esx_policejob" }as the last_internalOptsargumentif (config.logs.esxPoliceEvents?.enabled)config.logs.esxPoliceEvents.datasetas the dataset2. Update
config.jsonAdd inside
"logs":3. Update
config.schema.jsonAdd the schema entry for
esxPoliceEventsfollowing the exact same structure as the existing entries likeoxInventoryEvents:Also add
"esxPoliceEvents"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.tsThe 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 me look at some key ESX server files to understand what events are emitted:
Assistant: Now let me look at key ESX server-side files to understand the events fired:
Assistant: Now let me dig into the key ESX server files to understand the available events and callbacks:
Assistant: Looking at the full ESX ecosystem and the existing SDK patterns, here's a comprehensive breakdown of what can be automated as new ESX-specific log integrations in
fivemanage/sdk, modelled after the existingfeatures/logs/server/third-party/ox-inventory.tspattern.ESX Integration Plan for
fivemanage/sdkHow the SDK works (quick summary)
The SDK pattern is consistent and clear:
features/logs/server/third-party/<name>.tsingest(dataset, level, message, metadata)from../loggerconfig.logs.<featureName>.enabledflag +datasetinconfig.jsonlogger.tsalongside the othersNew file:
features/logs/server/third-party/esx.tsThis single file covers the entire ESX core (
es_extended) by listening to the server events and exported callbacks ESX fires. Below is the full proposed implementation with all suggested event hooks.esx_core— `e...This pull request was created from Copilot chat.