powered by Jive Software

Need to write Smack debugger logs in to a file

I need to write all the log details from smack debugger into a separate file. It will be really helpful for my debugging from the customer site.

Smack version: 4.4.2

I have added “smack-debug-4.4.2.jar” and “smack-debug-slf4j-4.4.2.jar” into my class path and enabled the debug configuration at code level.
Code Sample:

XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();
builder.enableDefaultDebugger();

While running my project I am able to see the Smack Debug Window with all request and response details. I researched writing those logs in a separate file. But I don’t find any solutions.
Is it possible to write those logs in a file. It will be helpful if you can suggest some solutions.
Thanks in Advance!!

I recommend looking at the source code how Smack debuggers can be hooked into Smack and extended. Then you can basically do everything with the received log messages, including writing them to a file.