Troubleshooting & FAQ
Common Issues
Config Not Loading
Symptoms: Changes to logfilter.json have no effect.
- Check JSON syntax — A missing comma, bracket, or quote causes the entire file to fail silently. Use a JSON validator. Check the game log for
[LogFilter] Failed to load configerrors. - Check the file location — The file must be at
config/logfilter.jsonrelative to your game directory. - Check
enabled— Make sure the top-level"enabled": trueis set. - Check individual rules — Each rule has its own
enabledfield that must betrue.
Rules Not Matching
Symptoms: A rule is enabled but log messages are still appearing.
- Check the
typefield — Make sure you're using the right match type:MESSAGE_REGEXmatches the message textLOGGER_NAMEmatches the logger's name (not the message)LOGGER_REGEXmatches the logger's name with regexLEVELmatches the log level
- Check the
pattern— ForLOGGER_NAME, the pattern must match the logger's fully qualified name (e.g.,net.minecraft.server.level, not justserver.level). - Check the
levelrestriction — If your rule has alevelfield, it only matches messages at that specific level. - Check rule order — An earlier
ALLOWrule may be permitting the message before yourDENYrule is reached. - Check regex escaping — In JSON, backslashes must be doubled. The regex
\d+is written as\\d+.
Regex Pattern Errors
Symptoms: A rule with MESSAGE_REGEX or LOGGER_REGEX type isn't working, and you see a warning in the log.
- Check the game log for
[LogFilter] Skipping rule '...': invalid regex pattern— this indicates a syntax error in your regex. - Double-check JSON escaping — Every
\in a regex must be written as\\in JSON:\d→\\d\s→\\s\.→\\.\\(literal backslash) →\\\\
- Test your regex — Use an online Java regex tester to verify your pattern works before putting it in the config.
Hot-Reload Not Working
Symptoms: Saving the config file doesn't trigger a reload.
- Check the log — You should see
[LogFilter] LogFilter config reloadedafter saving. If you don't see this message, the file watcher may not be running. - Check file location — The watcher monitors the
config/directory. If you're editing a copy elsewhere, changes won't be detected. - Some editors use atomic saves — Editors that write to a temporary file and rename may trigger the watcher normally. If your editor doesn't, try saving twice or using a different editor.
- Restart as fallback — If hot-reload isn't working, restarting the game will always load the latest config.
JSON Syntax Errors
Common JSON mistakes:
Trailing comma:
// Wrong
"rules": [
{"name": "Rule 1", "enabled": true, "type": "LEVEL", "pattern": "DEBUG", "action": "DENY"},
{"name": "Rule 2", "enabled": true, "type": "LEVEL", "pattern": "TRACE", "action": "DENY"},
]
// Correct
"rules": [
{"name": "Rule 1", "enabled": true, "type": "LEVEL", "pattern": "DEBUG", "action": "DENY"},
{"name": "Rule 2", "enabled": true, "type": "LEVEL", "pattern": "TRACE", "action": "DENY"}
]
Unquoted keys:
// Wrong
{enabled: true, rules: []}
// Correct
{"enabled": true, "rules": []}
Single quotes:
// Wrong
{'enabled': true, 'rules': []}
// Correct
{"enabled": true, "rules": []}
Paste your config into a JSON validator if changes aren't taking effect.
FAQ
Does LogFilter work on servers?
Yes. LogFilter operates at the Log4j2 level, which runs identically on client and server. Install it on the server and place the config at config/logfilter.json relative to the server root.
Does it affect performance?
Negligibly. The filter evaluates rules against each log message, but this is an extremely lightweight operation — regex matching and string comparison on log text. The overhead is insignificant compared to the I/O cost of writing log messages to disk.
Do I need to restart the game after changing the config?
No. LogFilter watches the config file and automatically reloads it when changes are detected. You should see a reload confirmation in the log within about half a second of saving.
Can I use LogFilter alongside other logging mods?
Yes. LogFilter attaches as a standard Log4j2 filter to the root logger. It is compatible with other mods that modify logging behavior.
What happens if my regex is invalid?
The rule is skipped with a warning in the log: Skipping rule '...': invalid regex pattern '...'. All other rules continue to function normally.
Can I filter LogFilter's own messages?
No. LogFilter explicitly exempts its own messages from filtering. This ensures you always see initialization and reload confirmations.
Does the config support comments?
No. Standard JSON does not support comments. If you need to annotate your config, use the name field on each rule for descriptions, or keep notes in a separate file.
What does NEUTRAL action do?
NEUTRAL means "no decision." The rule matches but doesn't filter or explicitly allow the message — evaluation continues to the next rule. This is useful for testing whether a pattern matches without actually filtering anything.
What's the difference between LOGGER_NAME and LOGGER_REGEX?
LOGGER_NAME does exact string matching with hierarchy support (e.g., net.minecraft.server.level also matches net.minecraft.server.level.ServerLevel). LOGGER_REGEX uses a Java regex pattern for more flexible matching but doesn't have built-in hierarchy support.
Getting Help
If you encounter an issue not covered here:
- Check the game log for
[LogFilter]messages — they often explain what went wrong - Verify your JSON syntax with a validator
- Join the Discord Server for community support
Next Steps
- Getting Started — Installation and first-time setup
- Configuration Reference — Full config documentation
- Examples — Real-world filtering scenarios