Skip to content

添加使用调试级别 log4j2 配置文件选项 #4144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

CiiLu
Copy link
Contributor

@CiiLu CiiLu commented Jul 29, 2025

在崩溃群排查错误的过程中,因为 HMCL 给游戏提供的 log4j2.xml 可能会丢失一些需要的信息,需要用户手动替换一个日志级别低的 log4j2 文件

先下载这个文件,把它放到游戏文件夹里的 config 文件夹里 https://gitee.com/zekerzhayard/HMCL-KOOK-Resources/releases/download/2024.2.5/log4j2.xml ,然后在 HMCL 的「游戏特定设置」(不是全局游戏设置)里的「Java 虚拟机参数」里加 -Dlog4j2.formatMsgNoLookups=false -Dlog4j.configurationFile=config/log4j2.xml

让用户自己操作非常容易出错且沟通成本高,因此需要一个快捷选项方便用户使用。本 PR 在游戏高级设置里添加了相关选项,可以一键切换到预设的低级别 log4j2 配置文件
图片

@Glavo
Copy link
Member

Glavo commented Jul 29, 2025

关于 log4j,我们正在考虑是否可以不再打包 log4j2.xml,而是遵循默认的配置。

Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
@CiiLu CiiLu requested a review from 3gf8jv4dv July 30, 2025 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants