đ Logging Settings
Configure comprehensive logging for all TKI Auth activities, including Advanced Logging with Discord forum integration.
Configuration Overviewâ
Logging:
Enabled: true
AdvancedLogging:
Enabled: true
PostName: "{userid}-logs"
ForumChannelID: "1376996299114549429"
StoreRequests: true
StoreLicenses: true
Product:
ProductCreation: "1376982897386459217"
ProductDeletion: "1376982897386459217"
ProductVersionChange: "1376982897386459217"
License:
LicenseCreation: "1370863315341017109"
LicenseDeletion: "1376982858962305164"
# ... more license logging settings
Main Logging Controlâ
Enabledâ
Type: boolean
| Required: Yes | Default: true
Master switch for all logging functionality.
Enabled: true # Enables all logging features
Enabled: false # Disables all logging (not recommended)
Always keep logging enabled in production for security auditing, troubleshooting, and compliance purposes.
Advanced Loggingâ
Advanced Logging creates individual Discord forum threads for each user, organizing all their license activities and API requests in one place.
AdvancedLogging.Enabledâ
Type: boolean
| Required: Yes | Default: false
Enables the Advanced Logging system with forum thread integration.
AdvancedLogging:
Enabled: true # Creates user-specific forum threads
Enabled: false # Uses only traditional channel logging
AdvancedLogging.PostNameâ
Type: string
| Required: Yes | Default: "{userid}-logs"
Template for forum thread names. Supports dynamic variables.
PostName: "{userid}-logs" # Results in: "123456789-logs"
PostName: "{username} Activity" # Results in: "john_doe Activity"
PostName: "{product} - {username}" # Results in: "MyApp - john_doe"
Available Variables:
Variable | Description | Example |
---|---|---|
{userid} | Discord User ID | 123456789012345678 |
{username} | Discord Username | john_doe |
{discriminator} | Discord Discriminator | 0001 |
{tag} | Full Discord Tag | john_doe#0001 |
{licensekey} | License Key | TKI-ABC12-DEF34 |
{product} | Product Name | MyAwesomeApp |
{timestamp} | Current Date | 2024-01-15 |
AdvancedLogging.ForumChannelIDâ
Type: string
| Required: Yes when Advanced Logging enabled
Discord forum channel ID where user threads will be created.
ForumChannelID: "1376996299114549429" # Valid forum channel ID
ForumChannelID: "" # Disabled (leave empty)
- Create a Discord forum channel in your server
- Right-click the channel â Copy Channel ID
- Ensure the bot has permissions to create threads in this channel
AdvancedLogging.StoreRequestsâ
Type: boolean
| Required: Yes | Default: true
Whether to store API authentication requests in user forum threads.
StoreRequests: true # API requests logged to user threads
StoreRequests: false # API requests only in traditional channels
AdvancedLogging.StoreLicensesâ
Type: boolean
| Required: Yes | Default: true
Whether to store license activities (creation, deletion, updates) in user forum threads.
StoreLicenses: true # License activities logged to user threads
StoreLicenses: false # License activities only in traditional channels
Product Loggingâ
ProductCreationâ
Type: string
| Required: No
Discord channel ID for logging product creation events.
ProductCreation: "1376982897386459217" # Channel ID
ProductCreation: "" # Disabled (leave empty)
ProductDeletionâ
Type: string
| Required: No
Discord channel ID for logging product deletion events.
ProductDeletion: "1376982897386459217" # Channel ID
ProductDeletion: "" # Disabled (leave empty)
ProductVersionChangeâ
Type: string
| Required: No
Discord channel ID for logging product version changes.
ProductVersionChange: "1376982897386459217" # Channel ID
ProductVersionChange: "" # Disabled (leave empty)
License Loggingâ
LicenseCreationâ
Type: string
| Required: No
Discord channel ID for logging license creation events.
LicenseCreation: "1370863315341017109" # Channel ID
LicenseCreation: "" # Disabled (leave empty)
LicenseDeletionâ
Type: string
| Required: No
Discord channel ID for logging license deletion events.
LicenseDeletion: "1376982858962305164" # Channel ID
LicenseDeletion: "" # Disabled (leave empty)
LicenseUpdateâ
Type: string
| Required: No
Discord channel ID for logging license update events (expiry changes, cap modifications, etc.).
LicenseUpdate: "1370863315341017109" # Channel ID
LicenseUpdate: "" # Disabled (leave empty)
Staff License Loggingâ
StaffLicenseCreationâ
Type: string
| Required: No
Discord channel ID for logging staff license creation events.
StaffLicenseCreation: "1376982945008451594" # Channel ID
StaffLicenseCreation: "" # Disabled (leave empty)
StaffLicenseDeletionâ
Type: string
| Required: No
Discord channel ID for logging staff license deletion events.
StaffLicenseDeletion: "1376982945008451594" # Channel ID
StaffLicenseDeletion: "" # Disabled (leave empty)
StaffLicenseUpdateâ
Type: string
| Required: No
Discord channel ID for logging staff license update events.
StaffLicenseUpdate: "1376982945008451594" # Channel ID
StaffLicenseUpdate: "" # Disabled (leave empty)
Blacklist Loggingâ
BlacklistCreationâ
Type: string
| Required: No
Discord channel ID for logging when items are added to the blacklist.
BlacklistCreation: "1376983757588004964" # Channel ID
BlacklistCreation: "" # Disabled (leave empty)
BlacklistRemovalâ
Type: string
| Required: No
Discord channel ID for logging when items are removed from the blacklist.
BlacklistRemoval: "1376983757588004964" # Channel ID
BlacklistRemoval: "" # Disabled (leave empty)
Request Loggingâ
RequestSuccessâ
Type: string
| Required: No
Discord channel ID for logging successful API authentication requests.
RequestSuccess: "1376983841666764931" # Channel ID
RequestSuccess: "" # Disabled (leave empty)
RequestRejectedâ
Type: string
| Required: No
Discord channel ID for logging rejected/failed API authentication requests.
RequestRejected: "1376983841666764931" # Channel ID
RequestRejected: "" # Disabled (leave empty)
Example Configurationsâ
Complete Logging Setupâ
Logging:
Enabled: true
AdvancedLogging:
Enabled: true
PostName: "{username} - {product}"
ForumChannelID: "1376996299114549429"
StoreRequests: true
StoreLicenses: true
Product:
ProductCreation: "1376982897386459217"
ProductDeletion: "1376982897386459217"
ProductVersionChange: "1376982897386459217"
License:
LicenseCreation: "1370863315341017109"
LicenseDeletion: "1376982858962305164"
LicenseUpdate: "1370863315341017109"
StaffLicenseCreation: "1376982945008451594"
StaffLicenseDeletion: "1376982945008451594"
StaffLicenseUpdate: "1376982945008451594"
Blacklist:
BlacklistCreation: "1376983757588004964"
BlacklistRemoval: "1376983757588004964"
Request:
RequestSuccess: "1376983841666764931"
RequestRejected: "1376983841666764931"
Minimal Logging Setupâ
Logging:
Enabled: true
AdvancedLogging:
Enabled: false
License:
LicenseCreation: "1370863315341017109"
LicenseDeletion: "1370863315341017109"
Request:
RequestSuccess: "1376983841666764931"
RequestRejected: "1376983841666764931"
Security-Focused Setupâ
Logging:
Enabled: true
AdvancedLogging:
Enabled: true
PostName: "{userid}-security-log"
ForumChannelID: "1376996299114549429"
StoreRequests: true
StoreLicenses: true
Blacklist:
BlacklistCreation: "1376983757588004964"
BlacklistRemoval: "1376983757588004964"
Request:
RequestSuccess: "" # Disabled to reduce noise
RequestRejected: "1376983841666764931" # Only log failures
Development Setupâ
Logging:
Enabled: true
AdvancedLogging:
Enabled: true
PostName: "DEV-{username}-{timestamp}"
ForumChannelID: "1376996299114549429"
StoreRequests: true
StoreLicenses: true
Product:
ProductCreation: "1376982897386459217"
ProductDeletion: "1376982897386459217"
ProductVersionChange: "1376982897386459217"
License:
LicenseCreation: "1370863315341017109"
LicenseDeletion: "1376982858962305164"
LicenseUpdate: "1370863315341017109"
Request:
RequestSuccess: "1376983841666764931"
RequestRejected: "1376983841666764931"
Advanced Logging Benefitsâ
đ Complete User Historyâ
Every user gets their own thread containing:
- All license activities (creation, updates, deletions)
- All API authentication attempts
- Complete timeline of interactions
- Easy access to user-specific information
đ Better Organizationâ
- No more scrolling through busy channels
- User-specific threads for targeted investigation
- Chronological order of all activities
- Easy search and reference
đĄī¸ Enhanced Securityâ
- Track suspicious user behavior patterns
- Identify potential license abuse
- Monitor authentication anomalies
- Maintain detailed audit trails
đ Improved Supportâ
- Quick access to user's complete history
- Better context for support requests
- Easier troubleshooting with organized data
- Faster resolution of user issues
Important Notesâ
Migration Considerationsâ
If you enable Advanced Logging on an existing system with licenses already created, forum threads will NOT be automatically created for existing users. You'll need to manually configure the forum channel ID in your MongoDB dashboard for existing licenses.
Dual Storageâ
When StoreLicenses
is true
and you have traditional channel logging enabled, events will be stored in BOTH the user's forum thread AND the specified channels. This ensures no information is lost during migration periods.
Performance Impactâ
- Advanced Logging adds minimal performance overhead
- Forum thread creation happens asynchronously
- Large volumes of requests are handled efficiently
- Database operations remain optimized
Troubleshootingâ
Common Issuesâ
Advanced Logging not working:
- Verify
ForumChannelID
points to a forum channel (not regular channel) - Check bot permissions in the forum channel
- Ensure
Enabled: true
for both main logging and advanced logging - Verify the forum channel exists and is accessible
Missing logs:
- Check that channel IDs are correct and channels exist
- Verify bot has "Send Messages" permission in log channels
- Ensure the specific logging category is not set to empty string
""
- Check if the bot is online and connected
Forum threads not created:
- Confirm the channel is a forum channel type
- Verify bot has "Create Public Threads" permission
- Check that the bot can see and access the forum channel
- Ensure the channel ID is correct (use Developer Mode to copy)
Testing Your Setupâ
- Create a test license - Check if forum thread is created
- Make an API request - Verify request logging works
- Check all channels - Ensure logs appear in correct places
- Test variables - Verify forum thread names use variables correctly
Best Practicesâ
Channel Organizationâ
- Use separate channels for different log types
- Set appropriate permissions - only staff should see logs
- Regular cleanup - archive old log channels periodically
- Backup important logs - export critical log data
Forum Setupâ
- Create dedicated forum channel for Advanced Logging
- Set clear channel description explaining its purpose
- Configure appropriate permissions for staff access
- Regular maintenance - clean up old threads if needed
Securityâ
- Protect log channels - restrict access to authorized personnel only
- Regular auditing - review logs for suspicious activities
- Backup strategy - ensure log data is backed up
- Compliance - meet any regulatory logging requirements