跳到正文

Ember’s Log Filtering

作者:TysonTheEmber

A highly configurable log filtering mod for Minecraft

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

LogFilter

A highly configurable log filtering mod for Minecraft. Suppress noisy log messages, highlight important ones, and keep your console clean, all with hot-reloadable rules.

Wiki: https://tysontheember.dev/log-filter/intro/

Features

  • Regex message filtering: Match and suppress log messages by content using regular expressions
  • Logger name filtering: Filter by exact logger name or regex pattern, with hierarchical matching
  • Log level filtering: Target specific log levels (DEBUG, INFO, WARN, ERROR)
  • Filter actions: DENY (suppress), ALLOW (force show), or NEUTRAL (pass through) per rule
  • Per-rule enable/disable: Toggle individual rules without removing them
  • Hot-reload: Edit logfilter.json and changes apply instantly, no restart needed
  • Default rules included: Ships with pre-made (disabled) rules for common log spam

Configuration

LogFilter stores its config in logfilter.json in your Minecraft config directory. The file is created automatically on first launch with sensible defaults.

Example Config

{
  "configVersion": 1,
  "enabled": true,
  "rules": [
    {
      "name": "Suppress OpenAL spam",
      "enabled": true,
      "type": "MESSAGE_REGEX",
      "pattern": "(?i)openal",
      "action": "DENY",
      "level": null
    },
    {
      "name": "Block debug logs from server level",
      "enabled": true,
      "type": "LOGGER_NAME",
      "pattern": "net.minecraft.server.level",
      "action": "DENY",
      "level": "DEBUG"
    },
    {
      "name": "Always show errors",
      "enabled": true,
      "type": "LEVEL",
      "pattern": "ERROR",
      "action": "ALLOW",
      "level": null
    }
  ]
}

Rule Types

| Type |Description |
| ————- |—————————————————– |
| MESSAGE_REGEX |Match the log message content against a regex pattern |
| LOGGER_NAME |Match by exact logger name or prefix (hierarchical) |
| LOGGER_REGEX |Match logger names using a regex pattern |
| LEVEL |Match by log level (DEBUG, INFO, WARN, ERROR) |

Actions

| Action |Description |
| ——- |—————————————————- |
| DENY |Suppress the log message |
| ALLOW |Force the message through, regardless of other rules |
| NEUTRAL |No effect, pass through to the next rule |

Optional Level Restriction

Any rule can include a level field to restrict it to a specific log level. For example, a LOGGER_NAME rule with "level": "DEBUG" will only match debug messages from that logger.

Default Rules

LogFilter ships with several pre-configured rules (disabled by default) to get you started:

  • Suppress OpenAL/LWJGL info spam
  • Suppress advancement loading messages
  • Suppress debug logs from net.minecraft.server.level
  • Suppress recipe loading messages
  • Always allow ERROR-level messages

Enable them by setting "enabled": true in the config file.

常见问题

Ember’s Log Filtering 支持哪些 Minecraft 版本?

Ember’s Log Filtering 支持 Minecraft Java 版 1.20.1–1.21.1,共 2 个版本,可用的加载器:Fabric / Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。

Ember’s Log Filtering 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端和服务端都要装。

评论

登录后评论和评分

TysonTheEmber 的其他作品

查看全部 →