ConsoleLogs
Overview
Section titled “Overview”ConsoleLogs is a powerful module that creates a bidirectional bridge between your Minecraft server console and Discord. Whether you want to monitor your server logs in real-time or send custom debug messages to your console, this module has you covered.
Features
Section titled “Features”- Console to Discord: Read log messages from your Minecraft server console and send them straight to Discord channels
- Discord to Console: Send custom log messages to your server console for debugging and monitoring
- Real-time Monitoring: Keep track of server events, warnings, and errors without leaving Discord
- Flexible Integration: Works seamlessly with DiSky’s event system
Installation
Section titled “Installation”-
Download the module
Download ConsoleLogs from one of these sources:
-
Install the module
Place the downloaded JAR file in your server’s
plugins/DiSky/modules/directory. -
Restart your server
Restart your Minecraft server to load the module.
-
Verify installation
Check your server console for a message confirming ConsoleLogs has been loaded successfully.
Usage Examples
Section titled “Usage Examples”Reading Console Logs
Section titled “Reading Console Logs”To read and forward console messages to Discord, you can use DiSky’s console event system:
# Monitor all console messages and send them to a Discord channelon console message: # Get the log message set {_message} to event-string
# Send to a specific Discord channel set {_channel} to text channel with id "YOUR_CHANNEL_ID" in bot "YOUR_BOT_NAME" send {_message} to {_channel}Filtering Important Messages
Section titled “Filtering Important Messages”You can filter messages to only send specific types of logs (errors, warnings, etc.):
# Only send error messages to Discordon console message: set {_message} to event-string
# Check if message contains error keywords if {_message} contains "ERROR" or "SEVERE" or "Exception": set {_channel} to text channel with id "YOUR_ERROR_CHANNEL_ID" in bot "YOUR_BOT_NAME" send "🚨 **Server Error:** %nl%%{_message}%" to {_channel}Sending Custom Debug Messages
Section titled “Sending Custom Debug Messages”Send custom log messages to your server console for debugging:
# Discord command to send a debug message to consolediscord command debug <text>: prefixes: ! roles: Administrator trigger: # Send the message to console send "Debug from %mention tag of event-user%: %arg-1%" to console
# Confirm to Discord reply with "Debug message sent to console!"Advanced Monitoring System
Section titled “Advanced Monitoring System”Create a comprehensive monitoring system with multiple channels:
# Complete console monitoring systemon console message: set {_message} to event-string set {_bot} to bot named "YOUR_BOT_NAME"
# Error channel if {_message} contains "ERROR" or "SEVERE" or "Exception": set {_channel} to text channel with id "ERROR_CHANNEL_ID" with {_bot} make embed: set title of embed to "❌ Server Error" set description of embed to {_message} set color of embed to red send last embed to {_channel} stop
# Warning channel if {_message} contains "WARN" or "WARNING": set {_channel} to text channel with id "WARNING_CHANNEL_ID" with {_bot} make embed: set title of embed to "⚠️ Server Warning" set description of embed to {_message} set color of embed to orange send last embed to {_channel} stop
# General logs channel set {_channel} to text channel with id "LOGS_CHANNEL_ID" with {_bot} send {_message} to {_channel}Use Cases
Section titled “Use Cases”Server Administration
Section titled “Server Administration”Monitor your server health and catch issues before they become problems:
- Track player joins/leaves
- Monitor plugin errors
- Catch performance warnings
- Debug command issues
Development & Testing
Section titled “Development & Testing”Use ConsoleLogs during development to streamline your workflow:
# Send debug messages during developmentset {_data} to some valuesend "DEBUG: Variable value is %{_data}%" to console
# This appears in both server console and DiscordSecurity & Auditing
Section titled “Security & Auditing”Keep an audit trail of important server events:
# Log important actions to console and Discordon player command: if command contains "op" or "deop" or "gamemode": send "AUDIT: %player% executed: /%command%" to consoleTroubleshooting
Section titled “Troubleshooting”Messages Not Appearing
Section titled “Messages Not Appearing”- Verify bot permissions: Ensure your bot has permission to send messages in the target channel
- Check channel IDs: Double-check that you’re using the correct Discord channel IDs
- Confirm bot status: Make sure your DiSky bot is online and connected
Too Many Messages
Section titled “Too Many Messages”If you’re getting flooded with console messages:
# Add rate limitingon console message: # Only send every 5th message add 1 to {console.counter} if {console.counter} is greater than or equal to 5: set {console.counter} to 0 # Send to Discord set {_channel} to text channel with id "CHANNEL_ID" in bot "BOT_NAME" send event-string to {_channel}Performance Concerns
Section titled “Performance Concerns”Best Practices
Section titled “Best Practices”- Filter Messages: Don’t forward every console message—focus on important events
- Use Separate Channels: Create different Discord channels for errors, warnings, and general logs
- Rate Limiting: Implement rate limiting to prevent spam
- Format Messages: Use embeds for better readability in Discord
- Security: Never expose sensitive information from console logs in public Discord channels
Next Steps
Section titled “Next Steps”- Getting Started with DiSky - Learn the basics of DiSky
- Events Guide - Master DiSky’s event system
- Messages Guide - Learn about advanced message handling
- Other Modules - Explore more DiSky modules
Support
Section titled “Support”Need help with ConsoleLogs? Join the DiSky community: