feat: add qbx_management event logging integration#26
Open
Conversation
Agent-Logs-Url: https://github.com/fivemanage/sdk/sessions/ea8de92d-cd33-45c1-bbbb-05ed8ff089c5 Co-authored-by: itschip <59088889+itschip@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add third-party logging integration for qbx_management
feat: add qbx_management event logging integration
Apr 2, 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 passive server-side logging integration for
qbx_management(Qbox job/gang management), following the same pattern asox-inventory.ts. Intercepts framework events viaon/onNetand pipes them throughingest()— no modifications to any Qbox resource required.New file:
features/logs/server/third-party/qbx-management.tsSix events intercepted:
QBCore:Server:OnPlayerLoadedonNetqbx_management.player.loadedQBCore:Server:OnPlayerUnloadonqbx_management.player.unloadedQBCore:Server:SetDutyonqbx_management.player.clockedIn/.clockedOutQBCore:Server:OnJobUpdateonqbx_management.player.jobUpdatedqbx_core:server:onJobUpdateonqbx_management.job.definitionUpdatedqbx_core:server:onGangUpdateonqbx_management.gang.definitionUpdatedAll events include rich metadata (player source, name, job/gang payload) for dashboard filtering.
onNethandlers captureglobal.sourceimmediately;onhandlers with asourceparam use it directly.Config changes
config.json—qbxManagementEvents: { enabled: false, dataset: "default" }config.schema.json— schema +requiredentry forqbxManagementEventsfeatures/utils/common/config.ts—qbxManagementEvents: EventConfigSchemaadded to valibot schemafeatures/logs/server/logger.ts—import './third-party/qbx-management'Original prompt
Overview
Add a new third-party logging integration for
qbx_management— the Qbox job/gang management resource. This follows the exact same pattern asfeatures/logs/server/third-party/ox-inventory.ts.Files to create/modify
1. Create
features/logs/server/third-party/qbx-management.tsIntercepts server-side events from
qbx_managementand logs them through the SDK'singest()function.Rules:
config.logs.qbxManagementEvents.enabledconfig.logs.qbxManagementEvents.dataset_internal_RESOURCE: "qbx_management"in_internalOpts"qbx_management.player.clockedIn") — simple and searchableglobal.sourceto capture source insideonNethandlersingestfrom"../logger"andconfigfrom"~/utils/common/config"Events to intercept:
QBCore:Server:OnPlayerLoaded(viaonNet) — no params, source is the player"qbx_management.player.loaded"{ playerSource, playerName: GetPlayerName(source.toString()) }QBCore:Server:OnPlayerUnload(viaon) — source is available viaglobal.source"qbx_management.player.unloaded"{ playerSource: source }QBCore:Server:SetDuty(viaon) — handler receives(source: number, duty: boolean)duty ? "qbx_management.player.clockedIn" : "qbx_management.player.clockedOut"{ playerSource: source, playerName: GetPlayerName(source.toString()), onDuty: duty }QBCore:Server:OnJobUpdate(viaon) — handler receives(source: number, job: unknown)"qbx_management.player.jobUpdated"{ playerSource: source, playerName: GetPlayerName(source.toString()), job }qbx_core:server:onJobUpdate(viaon) — handler receives(jobName: string, job: unknown)— job definition updated"qbx_management.job.definitionUpdated"{ jobName, job }qbx_core:server:onGangUpdate(viaon) — handler receives(gangName: string, gang: unknown)— gang definition updated"qbx_management.gang.definitionUpdated"{ gangName, gang }2. Modify
features/logs/server/logger.tsAdd the import after existing third-party imports:
3. Modify
config.jsonAdd inside
"logs":4. Modify
config.schema.jsonAdd schema entry for
qbxManagementEventsinproperties.logs.propertiesand in therequiredarray:Notes
onNet=RegisterNetEvent(client triggers server),on=AddEventHandler(server-side)onhandlers that receivesourceas a parameter (likeQBCore:Server:SetDuty), use the parameter directly — do NOT useglobal.sourceonNethandlers, capture withconst _source = global.sourceat the top of the handler (same pattern asplayer.ts)QBCore:Server:OnPlayerUnloadis anAddEventHandlerwhere source isglobal.source(no parameters)ox-inventory.tsThe following is the prior conversation context from the user's chat exploration (may be truncated):
User: How should I integrate these qbox FiveM resources into my fivemanage/sdk resource to handle logging for these qbox FiveM resources. I'm trying to create a large SDK that supports logging for different FiveM frameworks and I need to intercept FiveM events from other resources and log data.
Can you create a little plan of what's possible from what I just added of repos here?
Assistant: Now I have a thorough picture of all repos. Here's the integration plan:
Integration Plan: Qbox →
fivemanage/sdkLoggingHow the SDK Works (Key Architecture)
The
fivemanage/sdkis already a standalone FiveM resource (TypeScript → compileddist/server.js). It exposes:FivemanageTransportthat ships logs to Fivemanage's cloudexports.fmsdk.Log(...),exports.fmsdk.Info(...), etc.) that any Lua resource can callfeatures/logs/server/third-party/— ox-inventory is the onl...This pull request was created from Copilot chat.