Skip to content

Feature: Added definable dataset for fivemanage logging#45

Merged
antond15 merged 2 commits intoCommunityOx:mainfrom
Maximus7474:main
Sep 4, 2025
Merged

Feature: Added definable dataset for fivemanage logging#45
antond15 merged 2 commits intoCommunityOx:mainfrom
Maximus7474:main

Conversation

@Maximus7474
Copy link
Member

This PR adds a simple convar that server owners can set to define the dataset they want to use when using ox_lib logger alongside fivemanage.

Details:

  • Added convar: fivemanage:dataset
    • defaults to: "default"

According to the outcome of this PR, another will be made for updating the documentation relating to this change.

@Maximus7474 Maximus7474 marked this pull request as draft September 1, 2025 12:49
@Maximus7474
Copy link
Member Author

Maximus7474 commented Sep 1, 2025

Still need to test it on a server, will do when able.

I'm also tempted to alter the behaviour to have the header value added dynamically.
i.e.

local dataset = GetConvar('fivemanage:dataset', '')

if key ~= '' then
    local endpoint = 'https://api.fivemanage.com/api/logs/batch'

    local headers = {
        ['Content-Type'] = 'application/json',
        ['Authorization'] = key,
        ['User-Agent'] = 'ox_lib
    }
    
    if dataset then
        headers['X-Fivemanage-Dataset'] = dataset
    end

EDIT: I went with this approach, seemed more "user friendly" as it's possible they might have renamed or deleted the dataset. Should avoid any complaints coming through of it not logging.

…r for it isn't set

-> will let fivemanage determine the "default" dataset to use
@Maximus7474 Maximus7474 marked this pull request as ready for review September 1, 2025 17:25
@amrizama
Copy link

amrizama commented Sep 2, 2025

Tested on my server, Working great

Copy link
Member

@antond15 antond15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the PR

@antond15 antond15 merged commit 56c0a91 into CommunityOx:main Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants