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:

- Client Traffic (red text) -- raw XML traffic generated by Smack and sent to the server.
- Server Traffic (blue text) -- raw XML traffic sent by the server to the client.
- Interpreted Packets (green text) -- shows XML packets from the server as parsed by Smack.

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;`