Documentation
Documentation copied to clipboard
Mod-specific Logger & Logger configuration setup
Having a page in the documentation (likely in utilities) would be beneficial to let newer modders know about the proper way to use the Log4j API and use the mod-specific Logger that FML provides. Additionally, documentation on configuring the logging.properties file would be greatly appreciated.
I don't think having Forge docs include stuff for the Log4j API (which IIRC includes the properties file) would be particularly useful. People should look at the Log4j documentation instead. I don't remember what the FML logger is but if it is actually different from Log4j that could be useful.
Additionally, Minecraft uses log4j2, which does not use logging.properties.
https://logging.apache.org/log4j/2.0/manual/configuration.html
Interesting, FML javadoc says it uses logging.properties in FMLPreinitializationEvent so I thought it still did. That might need updating then.
/**
* Get a logger instance configured to write to the FML Log as a parent, identified by modid. Handy for mod logging!
* Configurations can be applied through the <code>config/logging.properties</code> file, specifying logging levels
* for your ModID. Use this!
*
* @return A logger
*/
public Logger getModLog() { ...
However, there is no documentation (that I can find) on where to put this file or what to put in it.
That is, indeed, outdated. That was done 5 years ago before log4j2 was introduced.
If you want to write a better comment, I can make a commit to fix it.