sv_environment and log_level.
Setting the Environment
dev— Development mode (verbose logging, relaxed security)prod— Production mode (optimized performance, minimal logging)
Environment Behavior
Development (dev)
- Verbose console logging
- Detailed error messages
- Relaxed security checks
- Useful for debugging
Production (prod)
- Minimal logging (errors only)
- Optimized performance
- Full security features active
- Anti-cheat enabled
Log Level
Thelog_level convar controls logging verbosity. It uses a numeric value:
| Value | Description | Use Case |
|---|---|---|
0 | Minimal logging | Production |
1 | Basic logging | Light debugging |
2 | Verbose logging | Active debugging |
3+ | Very verbose | Deep debugging |
Higher values produce more verbose output. Use
0 in production, increase when troubleshooting issues.All Framework Convars
Here is a complete reference of convars used by Mythic Framework:Core Settings
| Convar | Type | Default | Description |
|---|---|---|---|
sv_environment | set | "prod" | Environment mode (dev or prod) |
log_level | setr | 0 | Logging verbosity (numeric, 0 = minimal) |
sv_access_role | set | 0 | Access role level |
mfw_version | setr | "1.0.0" | Framework version identifier |
discord_app | setr | — | Discord application ID (rich presence) |
Database Convars
| Convar | Type | Description |
|---|---|---|
mongodb_auth_url | set | MongoDB Auth DB connection string |
mongodb_auth_database | set | MongoDB Auth DB name (typically auth) |
mongodb_game_url | set | MongoDB Game DB connection string |
mongodb_game_database | set | MongoDB Game DB name (typically fivem) |
mysql_connection_string | set | MySQL connection string for oxmysql |
mysql_slow_query_warning | set | Slow query warning threshold in ms |
Discord Webhook Convars
| Convar | Description |
|---|---|
discord_admin_webhook | Admin action logging |
discord_connection_webhook | Player connection/disconnection logging |
discord_log_webhook | General logging |
discord_kill_webhook | Kill/death logging |
discord_error_webhook | Error and crash logging |
discord_pwnzor_webhook | Anti-cheat detection logging |
External Service Convars
| Convar | Description |
|---|---|
FIVEMANAGE_MEDIA_API_KEY | FiveManage API key for image uploads (gallery, photos) |
Network / FiveM Convars
| Convar | Description |
|---|---|
sv_hostname | Server name in browser |
sv_maxclients | Maximum player count |
sv_enforceGameBuild | Required game build version |
sv_licenseKey | FiveM license key |
steam_webApiKey | Steam Web API key |
onesync | OneSync mode (must be on) |
Reading Convars in Code
Lua (Server or Client)
Important: Convar Type Handling
Convars always return strings. Convert as needed:Custom Convars
You can define your own convars inserver.cfg for resource-specific configuration:
Use
set for convars that should only be readable server-side. Use setr for convars that should also be readable on the client via GetConvar.Complete server.cfg Reference
Troubleshooting
Convar Returns Empty String
Convar Returns Empty String
Problem:
GetConvar returns empty or default valueSolutions:- Verify the convar is set in server.cfg with
setkeyword: - Check for typos in the convar name
- Ensure server was restarted after changing server.cfg
- Always provide a default fallback:
Boolean Convars Always True
Boolean Convars Always True
Problem: Boolean check always evaluates to trueCause:
GetConvar returns strings, and any non-empty string is truthy in LuaSolution:Numeric Convars
Numeric Convars
Problem: Math operations fail on convar valuesSolution:
Next Steps
Server Configuration
Complete server.cfg guide
Database Connections
Configure database connection strings
Discord Webhooks
Set up webhook logging
Resource Management
Resource load order and dependencies