Skip to main content

📊 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)
Production Recommendation

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:

VariableDescriptionExample
{userid}Discord User ID123456789012345678
{username}Discord Usernamejohn_doe
{discriminator}Discord Discriminator0001
{tag}Full Discord Tagjohn_doe#0001
{licensekey}License KeyTKI-ABC12-DEF34
{product}Product NameMyAwesomeApp
{timestamp}Current Date2024-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)
Forum Channel Setup
  1. Create a Discord forum channel in your server
  2. Right-click the channel → Copy Channel ID
  3. 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​

Existing Licenses

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​

Dual Logging

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​

  1. Create a test license - Check if forum thread is created
  2. Make an API request - Verify request logging works
  3. Check all channels - Ensure logs appear in correct places
  4. Test variables - Verify forum thread names use variables correctly

Best Practices​

Channel Organization​

  1. Use separate channels for different log types
  2. Set appropriate permissions - only staff should see logs
  3. Regular cleanup - archive old log channels periodically
  4. Backup important logs - export critical log data

Forum Setup​

  1. Create dedicated forum channel for Advanced Logging
  2. Set clear channel description explaining its purpose
  3. Configure appropriate permissions for staff access
  4. Regular maintenance - clean up old threads if needed

Security​

  1. Protect log channels - restrict access to authorized personnel only
  2. Regular auditing - review logs for suspicious activities
  3. Backup strategy - ensure log data is backed up
  4. Compliance - meet any regulatory logging requirements