Logging & Metrics
QuanticPhone can log player actions (calls, messages, transfers, etc.) to Discord or ox_lib, and expose performance metrics via server console commands.
Activity logging
Config.Logs = {
Enabled = false, -- enable the logging system
Service = "discord", -- "discord" | "ox_lib"
Avatar = "https://...", -- Discord embed avatar URL
Dataset = "quanticphone", -- ox_lib dataset name (when Service = "ox_lib")
Actions = {
Call = true, -- log voice/video calls
Message = true, -- log sent messages
Twitter = true, -- log Threads posts
Transfer = true, -- log bank transfers
Gallery = false, -- log photo/video saves
Notes = false, -- log note creation/edits
Contacts = false, -- log contact changes
},
}Enabled = false in development. Enable only the actions you actually need — logging everything generates a lot of noise.Discord setup
When Service = "discord", create a webhook in your Discord channel and add it to server/apiKeys.lua:
ApiKeys = {
-- ...other keys...
LogsWebhook = "https://discord.com/api/webhooks/your-webhook-id/token",
}Each log entry is posted as a Discord embed with the player's name, action type, and relevant data (number called, amount transferred, etc.).
ox_lib setup
When Service = "ox_lib", logs are sent to the ox_lib logger using the dataset name defined in Config.Logs.Dataset. Configure ox_lib's logger separately in its own config.
Performance metrics
Config.Metrics = {
Enabled = true,
Commands = {
View = "metrics", -- /metrics in server console
Reset = "metrics_reset", -- /metrics_reset to clear counters
},
}When enabled, the resource tracks internal performance counters (query times, callback latency, active sessions). Run metrics in the server console to view a live report:
> metrics
[QuanticPhone] Performance Metrics
Active sessions : 12
DB queries/min : 47
Avg query time : 2.3ms
Callbacks fired : 1,204
Errors (last hr): 0Database checker
Config.DatabaseChecker = {
Enabled = true, -- run schema check on resource start
AutoCheck = true, -- auto-create missing tables
TablePrefix = "quantic_", -- prefix for all tables
}On startup, QuanticPhone verifies that all required tables exist in the database. If a table is missing (e.g. after a partial install), it is created automatically when AutoCheck = true. Disable this on production if you prefer manual schema control.
quantic_. Never rename or manually alter these tables — schema migrations are handled automatically on update.