ModsJava
Console logs to MySQL database
Java mod listed for Minecraft 1.21. Downloads from the MC Java Mods app on Android.
⬇ Download on SpigotI'll keep this brief.
IMPORTANT NOTE: Made for Paper 1.21.4, only tested on 1.21.4.
Context (skip if you want)
I tried to find a plugin out there that would log all of my Console logs, or rather, specific types (I.E. debug, error etc) to a database which I could report on via a website, as I am not always watching the console. I could not find a plugin that did this. So I made one.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
What does this plugin do?
The Configuration is easy right? Yes!
Here is the config, and further below I will explain what they mean. 2 spoilers.
IMPORTANT NOTE: Made for Paper 1.21.4, only tested on 1.21.4.
Context (skip if you want)
I tried to find a plugin out there that would log all of my Console logs, or rather, specific types (I.E. debug, error etc) to a database which I could report on via a website, as I am not always watching the console. I could not find a plugin that did this. So I made one.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
What does this plugin do?
- It logs:
- Fatal
- Error
- Warn
- Info
- Debug
- Trace
- StackTraces
- MDC
- Threadname
- etc
- To a MYSQL database you define
- Fully configurable. Don't want to log Debug? Turn it off. Shrimple.
- Purges old logs after a time period you define, dropping them in an order you define, I.E. oldest, newest, etc.
- No in game permissions
- No in game commands
- Plugin controlled entirely from the config.yml generated
- Plugin starts DEFAULTED to DISABLED; turn it on in the config, configure your MySQL database, then reboot
The Configuration is easy right? Yes!
Here is the config, and further below I will explain what they mean. 2 spoilers.
Spoiler: Full Config Code
Code (Text):
enabled: true # MUST be set to true before the plugin activates
mysql:
host:
port: 3306
database:
user:
password:
params:
pool:
minimumIdle: 2
maximumPoolSize: 8
connectionTimeoutMs: 10000
identify:
server_name: RANDOMNAME
server_uuid: b45aee08-c73e-43b8-bdf1-2f7d0487bb95 # auto-generate and save if blank
hostname: 23ad6bd8-4b1a-4c78-a168-95efa460c428 # auto-detect and save if blank
build_info: 'Paper 1.21.4-232-12d8fe0 (MC: 1.21.4)' # auto-detect Paper build if blank
capture:
fatal: true
errors: true
warns: true
info: true
debug: true
trace: false
includeStacktraces: true
includeMDC: true
includeThreadName: true
maxMessageLength: 65535
maxStackLength: 1000000
batching:
maxBatchSize: 200
flushIntervalMs: 1500
queueCapacity: 10000
dropPolicy: oldest # oldest | newest | block (block not used to avoid stalling logging threads)
retention:
enabled: false
days: 90
dailyRunHourUtc: 4
mysql:
host:
port: 3306
database:
user:
password:
params:
pool:
minimumIdle: 2
maximumPoolSize: 8
connectionTimeoutMs: 10000
identify:
server_name: RANDOMNAME
server_uuid: b45aee08-c73e-43b8-bdf1-2f7d0487bb95 # auto-generate and save if blank
hostname: 23ad6bd8-4b1a-4c78-a168-95efa460c428 # auto-detect and save if blank
build_info: 'Paper 1.21.4-232-12d8fe0 (MC: 1.21.4)' # auto-detect Paper build if blank
capture:
fatal: true
errors: true
warns: true
info: true
debug: true
trace: false
includeStacktraces: true
includeMDC: true
includeThreadName: true
maxMessageLength: 65535
maxStackLength: 1000000
batching:
maxBatchSize: 200
flushIntervalMs: 1500
queueCapacity: 10000
dropPolicy: oldest # oldest | newest | block (block not used to avoid stalling logging threads)
retention:
enabled: false
days: 90
dailyRunHourUtc: 4
Spoiler: Full Config Code Explained
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
enabled – Must be set to true for the plugin to start.
mysql – MySQL database connection details.
mysql – MySQL database connection details.
- host / port – Database address and port.
- database – Name of the database to store logs.
- user / password – Database login credentials.
- params – Extra JDBC connection options.
- pool – Connection pool settings for performance tuning.
- server_name – Friendly name for the server (any text).
- server_uuid – Unique ID for the server (auto-generated if blank).
- hostname – Hostname of the server (auto-detected if blank).
- build_info – Paper build/version info (auto-detected if blank).
- fatal, errors, warns, info, debug, trace – Enable/disable capturing of each log level.
- includeStacktraces – Store stack traces with errors.
- includeMDC – Store mapped diagnostic context (extra debug info).
- includeThreadName – Store the name of the thread that logged the message.
- maxMessageLength – Maximum length for stored log messages.
- maxStackLength – Maximum length for stored stack traces.
- maxBatchSize – Maximum logs sent in one database write.
- flushIntervalMs – How often (in ms) to flush logs to the database.
- queueCapacity – Maximum logs held in memory before dropping.
- dropPolicy – What to do if the queue is full (oldest, newest, or block).
- enabled – Turn automatic cleanup on/off.
- days – How many days of logs to keep.
- dailyRunHourUtc – Hour of day (UTC) when cleanup runs.
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.21
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
Console logs to MySQL database is a free Minecraft Java mod. Compatible with Minecraft 1.21. Downloaded 20 times (via Spigot). Download it and open it directly in the game.