Log Filter
The log filter is a high-performance tool for configuring filtered output of messages in the game log and console. This mod is primarily intended for pack creators, so when reporting bugs to other mod developers, it's advisable not to provide modified logs.
Usage
Below is an example configuration file ("log_filter.json") with comments that excludes all datapack loading failure messages from logs. Useful when, for instance, you're removing recipes by replacing them with empty files in a datapack. Important: remove comments before using!
{
"logEvents": "NONE",
"rules": [
{
"level": [
{
"relation": "EQUAL",
"value": "ERROR"
}
],
"loggerName": [
{
"relation": "MATCH",
"value": "net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener"
}
],
"formatMessage": [
{
"relation": "MATCH",
"value": "Couldn't parse data file {} from {}"
}
],
"parameterClasses": [
{
"0": {
"relation": "MATCH",
"value": "net.minecraft.resources.ResourceLocation"
},
"1": {
"relation": "MATCH",
"value": "net.minecraft.resources.ResourceLocation"
},
"2": {
"relation": "MATCH",
"value": "com.google.gson.JsonParseException"
}
}
]
}
]
}
Enabling the "logEvents" parameter transforms all log messages into the following format, suitable for fine-tuning the mod:
[20:18:10] [modloading-worker-0/INFO] [Log Filter/]: Logging event:
- Level: INFO
- Logger name: mezz.jei.library.load.PluginCaller
- Thread name: modloading-worker-0
- Throwable class: null
- Message: Sending ConfigManager...
- Format message: {}...
- Parameter classes: [java.lang.String]