Skip to content
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

Mod-specific Logger & Logger configuration setup #123

Open
joazlazer opened this issue Aug 5, 2017 · 5 comments
Open

Mod-specific Logger & Logger configuration setup #123

joazlazer opened this issue Aug 5, 2017 · 5 comments
Labels
Page Request Request for a new page for some topic

Comments

@joazlazer
Copy link

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.

@elifoster
Copy link
Contributor

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.

@kashike
Copy link

kashike commented Aug 5, 2017

Additionally, Minecraft uses log4j2, which does not use logging.properties.
https://logging.apache.org/log4j/2.0/manual/configuration.html

@joazlazer
Copy link
Author

joazlazer commented Aug 6, 2017

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.

@kashike
Copy link

kashike commented Aug 6, 2017

That is, indeed, outdated. That was done 5 years ago before log4j2 was introduced.

@mezz
Copy link

mezz commented Aug 6, 2017

If you want to write a better comment, I can make a commit to fix it.

@ChampionAsh5357 ChampionAsh5357 added the Page Request Request for a new page for some topic label Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Page Request Request for a new page for some topic
Projects
None yet
Development

No branches or pull requests

5 participants