LogFilter: Clean Up Your Minecraft Logs
Every modded Minecraft session generates a mountain of log output. Debug messages, trace calls, and repeated warnings pile up in the console and the log files until the one error you actually care about is buried under thousands of lines. LogFilter is a lightweight add-on built to solve exactly that problem. It sits inside the logging pipeline and quietly discards the noise before it ever reaches your console or disk.
What LogFilter Actually Does
LogFilter hooks into Log4j 2, the logging framework Minecraft uses, and mounts a custom filter on the root logger. Because nearly every log event flows through that root logger, a single filter can intercept global output. The mod then makes fast decisions using a fail-fast design: it checks log levels and logger names first, since those are cheap lookups, and only formats and regex-matches messages that survive the quick pass. That keeps the main thread overhead low even on heavily modded packs.
Core Filtering Tools
- Regex filtering: partial-match patterns catch whole families of messages, so a rule like
.*could not find sampler named.*removes every shader sampler warning at once. - Exact match filtering: block one specific line, case-sensitive, when you want surgical precision.
- Filter by logger: silence an entire class or mod, such as
net.minecraft.client.renderer.ShaderInstance. - Filter by log level: one-click blocking of TRACE, DEBUG, or even INFO so only warnings and errors remain.
- Whitelist mode: exclusion patterns protect critical errors from being filtered by accident.
- Deduplication cache: repeated identical messages are caught by hash and skipped without reprocessing.
There is also an optional async pipeline. When enabled, all root appenders are wrapped in a Log4j2 AsyncAppender, so console and file I/O run on a background thread while the logging thread only pays the enqueue cost. Queue size, overflow behavior, and shutdown timeout are all configurable.
Supported Versions and Loaders
LogFilter is built for Minecraft 1.20.1 on the Forge loader, matching the Log4j 2 setup used by that version. If you run a different Minecraft release, check the project page for a matching build before you download LogFilter, since logging internals can shift between versions.
How to Install LogFilter for Minecraft
Setup takes a few minutes. Here is how to install it:
- Download the mod's JAR file and drop it into the
modsfolder of your Minecraft installation. - Launch the game once. LogFilter generates a default config at
config/logfilter-common.toml. - Edit the file to add your rules, then save. The config hot-reloads automatically, so no restart is needed.
If you prefer, you can manually create logfilter-common.toml before the first launch and skip the generation step. One detail worth knowing: in double-quoted TOML strings, backslashes are consumed once, so literal parentheses must be written as \\( \\), while single-quoted strings accept \( \) directly. Invalid regexes are skipped with a warning in the log and a chat message when you enter a world, and the remaining rules keep working.
If you would rather skip manual file juggling, the foxygame.net launcher offers a one-click install path that drops LogFilter straight into the correct mods directory and keeps it updated as new builds appear.
A Practical Example
Consider a common warning about a shader failing to find a sampler. To block every variant of it, add a regex rule. To block only that exact sentence, use an exact match. To silence the whole class, add its logger name. To hide all warnings, set the level list to WARN, though that is rarely wise. Pick the narrowest rule that solves your problem and leave the rest of the log intact.
Final Thoughts
LogFilter is one of those small utilities that quietly improves every modded session. Fewer spam lines mean faster log reading, smaller files, and less disk churn, while the whitelist and deduplication cache keep important errors safe. Whether you are a pack developer chasing a crash or a player tired of scrolling past debug noise, a few well-chosen rules will transform your console into something you can actually read.
===ARTICLE===