I may have found a way to "enable" logging the way we are used to. Please, verify my train of thoughts:
[*]Fact: I'm using eclipse.
[*]Fact: Forge uses log4j2
[*]Fact: log4j2 is configured using properties/XML files.
If missing log4j(2) will log an error right at the beginning.
No error observed, log4j must be configured somewhere.
[*]Fact: The lib forgeSrc-<version>.jar contains a log4j2.xml
[*]Action: Copy this file to the root directory of the project.
Question: Which directory is the root?
[*]Observation: When starting the client using the eclipse launcher, a directory structure just like the one known from a normal forge installation is created within the "eclipse" dir.
[*]Action: Putting log4j2.xml into eclipse dir.
[*]Action: Verify which logger my mod gets in the pre-init phase.
FMLPreInitializationEvent event;
event.getModLog().getName()
Is seems to be one named like my MOD-ID.
[*]Action: Adding a logger for my mod to my log4j2.xml
<Loggers>
[...]
<Logger level="debug" name="myModId">
<AppenderRef ref="FmlSysOut" />
</Logger>
</Loggers>
(Not yet investigated what the 5 defined appenders do.)
[*]Action: Start client.
Observation: I'm still logging INFO.
[*]Action: Force log4j2 to load my file by adding a VM argument to the launcher config next to the memory size:
-Xincgc -Xmx1024M -Xms1024M -Dlog4j.configurationFile=log4j2.xml
[*]Action: Start client.
Observation: I'm logging DEBUG.
My idea is to have the dev env configured to log the way I want and not having to change my code or alter libs. Therefore, tweaking the launcher config and copying the logging config is acceptable, I think.