HMCL-dev / HMCL-dev/HMCL

[Feature] 添加「不使用启动器提供的 log4j2 配置文件」的快捷选项

Open
#2,393 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
10.1k
Forks
934
Avg merge
1d 5h
Merged PRs (30d)
82

Description

描述 Description

在「高级设置」中添加一个选项「不使用启动器提供的 log4j2 配置文件」,启用后 HMCL 不再添加以下参数

-Djava.rmi.server.useCodebaseOnly=true
-Dcom.sun.jndi.rmi.object.trustURLCodebase=false
-Dcom.sun.jndi.cosnaming.object.trustURLCodebase=false
-Dlog4j2.formatMsgNoLookups=true
-Dlog4j.configurationFile=<path>\log4j2.xml
原因 Why

在日常排查错误的过程中,因为 HMCL 给游戏提供的 log4j2.xml 会丢失很多有用的信息,让用户自己添加 -Dlog4j2.formatMsgNoLookups=false 参数非常容易出错,因此需要一个快捷选项方便用户使用。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the Advanced Settings UI and the code that assembles HMCL's JVM arguments. Check how the log4j2.xml path and listed system properties are added, then trace the setting's persistence and launch behavior. Done means the new option is available in Advanced Settings and, when enabled, none of those parameters are added while the normal path remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.