Smack is an excellent Java XMPP Library. While creating a pubsub broker in XMPP I faced a strange issue where few messages were missing. I then found a simple way to debug the Smack library. Just start your JVM (java) with the following option:
java -Dsmack.debugEnabled=true Class.Name

It opens up four tabs. The first tab (All) contains three panes - Sent, Received & Interpreted. The other tabs allow you to view one pane only (either of the three mentioned above).