Configuration

config_server.lua

Server-only settings: the log records, the Discord webhook, per-app log settings and where each app keeps its keys.

config_server.lua and every apps/<id>/config_server.lua are loaded on the server only. Never list them in shared_scripts or files. Webhooks and API keys belong here and nowhere else.

#How logging works

Every logged action is first written to the fx_pocketbook_audit table. If a webhook is set, a background loop sends the waiting rows to Discord, 10 at a time every 15 seconds, and marks each row sent, pending or failed. Without a webhook the rows stay local.

  • A 429 answer waits for the time Discord asks, then tries again.
  • Other failures are retried with a growing delay, up to 8 attempts.
  • A 4xx answer other than 429 marks the row failed at once.
  • pocketbook_retry_log <id> puts a failed row back in the queue.
  • Once an hour, local and sent rows older than RetentionDays are deleted. failed and pending rows are kept.

#PocketServerConfig.Logs

luaPocketServerConfig.Logs = {
    Enabled = true,
    Webhook = '',
    Username = 'FX-Pocketbook Logs',
    Identity = { Discord = true, DiscordMention = true, Steam = true, License = true,
        License2 = true, FiveM = true, IP = true, Character = true, Job = true },
    IncludeContent = false,
    Events = { All = true },
    StatusColors = { success=8350553, pending=13937988, rejected=12161125, failed=12161125 },
    EventColors = {},
    RetentionDays = 30
}
Setting Default What it does
Enabled true Write log records
Webhook '' Discord webhook for core actions. Accepted: https://discord.com, https://discordapp.com and their ptb. and canary. subdomains, with the path /api/webhooks/<id>/<token> (a versioned path such as /api/v10/webhooks/... works too). Any other address is never contacted. Empty: records stay local
Username 'FX-Pocketbook Logs' Name the webhook posts under
Identity all true Which identifiers of the player go into a record: Discord, DiscordMention (a <@id> mention), Steam, License, License2, FiveM, IP, Character (id, name, framework), Job (job and grade)
IncludeContent false Metadata is logged. Message and note contents are logged only when this is true
Events { All = true } Which actions are logged. someAction = false drops one. All = false logs only the actions set to true
StatusColors see above Embed colour per status, as a decimal number
EventColors {} Embed colour per action name, for example uiNotificationRendered = 8350553. Wins over StatusColors
RetentionDays 30 Days local and sent rows are kept. At least 1

#Per-app log settings

Each app with a config_server.lua has its own Logs table: album, atlas, billing, company, darkchat, katalog, mdt, music, news, telegram. When an app has one, its table is used in place of the core one for that app.

luaPocketServerConfig.Apps.news = {
    Logs = {
        Enabled = true,
        Webhook = '',            -- this app's Discord webhook
        UseCoreWebhook = true,   -- empty Webhook: use PocketServerConfig.Logs.Webhook
        Events = { All = true },
        Identity = { Discord = true, DiscordMention = true, Steam = true,
            License = true, License2 = true, FiveM = true, IP = true,
            Character = true, Job = true },
        IncludeContent = false
    }
}
Setting Default What it does
Enabled true Log this app
Webhook '' A webhook for this app only
UseCoreWebhook true With an empty Webhook, send to the core webhook
Events, Identity, IncludeContent as in the core table Same meaning, for this app

Username and RetentionDays are always read from the core table. StatusColors and EventColors fall back to the core table when the app has none.

#Other server-only settings

Some app files hold more than logs. They are described with their app:

File Keys Page
apps/billing/config_server.lua API (which resources may call the Ledger exports, rate limit) Finance apps
apps/company/config_server.lua Treasury.Bindings Finance apps
apps/telegram/config_server.lua Administration (government telegrams, forced mailbox closing) Telegraph
apps/kartlarim/config_server.lua API.AllowedResources, Identity Daily apps
apps/takvim/config_server.lua PaymentDays Daily apps
apps/music/config_server.lua Spotify.ClientId, Spotify.ClientSecret, YouTubeApiKey Phonograph, Album and Card Table