ejabberd - Comments for "Tool to use for debugging code of ejabberd server?" https://www.ejabberd.im/node/3748 en > Can anybody tell which tool https://www.ejabberd.im/node/3748#comment-54907 <p>&gt; Can anybody tell which tool to use for debugging code of ejabberd server?</p> <p>One simple way is to add 'printf' in the code. For example:</p> <pre>sum(A, B) -&gt; ?INFO_MSG("Now we'll try to sum ~p and ~p", [A, B]), Result = A+B, ?INFO_MSG("And the result of A+B is: ~p", [Result]), Result. </pre><p> &gt; like any debugger available for this?</p> <p>Erlang/OTP includes several debug tools, One graphical, one text-based, ... but I've never really used them in practice. The printf trick is a lot easier to setup for me :)</p> <p>&gt; As i need t check the flow of code like how new client register with ejabberd server, </p> <p>You can also increase the loglevel option in ejabberd.cfg</p> <p>&gt; how communication take place...</p> <p>To see network traffic you can use tools like tcpflow or Wireshark. Remember to disable encryption in ejabberd and the clients. Example usage for C2S if you have ejabberd running in your own machine:</p> <pre>sudo tcpflow -ec -i lo tcp port 5222</pre> Mon, 16 Nov 2009 22:57:15 +0000 mfoss comment 54907 at https://www.ejabberd.im