Debugging

The Notchian client and server (and additionally the launcher) can generate additional log information that what is normally displayed, some of which is extremely helpful for debugging. This can be done by specifying a custom Log4j configuration.

The native launcher provides a "Log config" section for doing this directly. For other situations, this can be done by  argument to the game:


 * [[media:ClientDebugging.png|In the JVM Arguments section of the Java launcher]]
 * Before the  in the server launch command
 * Before the  when directly invoking the

When using the native launcher, use the XML variant of the log config and check "Custom log config outputs XML". This allows the launcher to provide cleaner information in its output. When using the java launcher, or when launching a server, use the non-XML variant (you don't want XML in the console, and the XML variants don't work with the server GUI).

You can get the default configuration for the game by extracting  from the jar you wish to work with.

Options
There are only a few options that have useful behaviors within the log4j configuration.

The main one is  in. Normally, this is set to, but it accepts  ,  ,  ,  ,  ,  , and. The lowest level that is actually used by Minecraft is, so that one should be used for maximum additional information.

The other major option is the list of s.  By default, the game filters out information regarding packets with a   that rejects all log messages marked with. You can instead make it so that the filter only accepts  and rejects everything else, or alternatively you can remove the   entirely so that all messages are displayed. Beyond just, there are a few other log markers:  ,  ,  , and. and  behave identically;   and   can be used to show only one set of the packets; and   can be used to emit information about when a sound channel starts and stops (mostly only useful when diagnosing issues where a sound seems to be playing twice).

One other note: by default, log4j overwrites old logs if there are more than 7 for a day (see MC-100524). You can disable this behavior by adding a  to the , which makes the maximum 1000 files in a day (which is much less likely to be hit - 1000 is used over something larger because at larger numbers there starts to be a performance hit).

Network packets only
Applies to: vanilla client and server

Produces logs of all packets sent to and from the server/client, and nothing else (this also disables logging of normal content, including chat). Unfortunately, since the Netty rewrite (Minecraft 1.7) only packet IDs and classes are logged, and not their contents; however, this information may still be helpful.

Config:

Config (XML output):

All debug information
Applies to: vanilla client and server

You can log even more information if you want. This will print normal log messages (such as chat), but also network packets, sounds starting/stopping playing (client only), some authentication requests, and other miscellaneous information.

Config:

Config (XML output):

All debug information on CraftBukkit/Spigot
Applies to: CraftBukkit servers and servers that derive from CraftBukkit

Because CraftBukkit uses slightly different console output (and has no server GUI), the configuration needs to be slightly tweaked to display correctly. However, doing this will also display the remapped packet class names.

Config:

Launcher session information
Applies to: Launcher.jar

By enabling debug launching on the (Java launcher's) launcher.jar, you can view connections to the Mojang API - helpful if you want to see a sample connection to each endpoint for your own account.

Note that this configuration may not work if you invoke the normal launcher EXE/JAR - instead, use it on the  located in.

Config: