Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.16] How to change log level


hohserg
 Share

Recommended Posts

Minecraft and Forge contains some code like 

LOGGER.trace(CLASSLOADING, ...);

I want to see such messages in log (better to see all log messages).

I didn't find `log4j2.xml`or something similar at game jar.

How to change default log level?

Link to comment
Share on other sites

Oops, not solved

I use `-Dforge.logging.console.level=debug -Dforge.logging.markers=SCAN,REGISTRIES,REGISTRYDUMP,CLASSLOADING`

But messages of `LOGGER.trace(CLASSLOADING, ...)` is not visible in debug.log file

Link to comment
Share on other sites

You should put it in the run configuration in your build.gradle, then re-run the genXXXRuns task which will update your run configurations. Otherwise it will be overridden next time you run it.

 

10 minutes ago, hohserg said:

I use `-Dforge.logging.console.level=debug -Dforge.logging.markers=SCAN,REGISTRIES,REGISTRYDUMP,CLASSLOADING`

But messages of `LOGGER.trace(CLASSLOADING, ...)` is not visible in debug.log file

You set the logging level to debug and are then confused why trace is not showing up...?

Link to comment
Share on other sites

The log4j log levels are as follows:

trace, debug, info, warn, error, fatal. If you configure the logging level to be e.g. INFO then anything below that (debug and trace) will be filtered out. Since you set the logging level to DEBUG, your trace log will not be shown.

The markers are a separate concept, for example Forge has a REGISTRYDUMP marker. When you log something using a logger, you can also specify a marker. That marker can then be used for additional filtering, for example you can tell log4j to not show any log messages that have the REGISTRYDUMP marker.

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.