Debugging with Smack

Smack includes a built-in debugging console that will let you track all XML traffic between the client and server.

When debugging mode is enabled, a debug window will appear when each new connection is created. The window will contain the following information:

Debugging mode can be enabled in two different ways:

  1. Add the following line of code before creating new connections:

    XMPPConection.DEBUG_ENABLED = true;

  2. Set the Java system property smack.debugEnabled to true. The system property can be set on the command line such as:

    java SomeApp -Dsmack.debugEnabled=true.

If you wish to explicity disable debug mode in your application, including using the command-line parameter, add the following line to your application before opening new connections:

XMPPConnection.DEBUG_ENABLED = false;