1

I try to analyze a problem related to XMPP. I have two server components joined the same MUC room on Prosody IM (it's hard to make my application to print those XMPPs they received/sent , i'm using jitsi jicofo and jitsi jigasi).

So, I was wondering if it is possible to print detailed XMPP messages sent/received in MUC.

My prosody logging configuration is as below:

log = {
        { levels = {min = "debug"} , to = "console"};
}

Above configuration gave me log output as follows:

c2s55b17ab56330                                         debug   Received[c2s]: <presence type='unavailable' id='AwXwU-149' to='123456789@conference.example.com/448ddea4'>
conference.example.com:muc                              debug   session qvagnu083x5-bl78@example.com/tYARglho is leaving occupant 123456789@conference.example.com/448ddea4
c2s55b17b2a8300                                         debug   Sending[c2s]: <presence from='123456789@conference.example.com/448ddea4' id='AwXwU-149' type='unavailable' to='tiqmjoyi7d3rr69-@example.com/9W3u-kLN'>
c2s55b17ae40d40                                         debug   Sending[c2s]: <presence from='123456789@conference.example.com/448ddea4' id='AwXwU-149' to='focus@auth.example.com/focus32210095996901258' type='unavailable' xmlns='jabber:client'>
c2s55b17ab56330                                         debug   Sending[c2s]: <presence from='123456789@conference.example.com/448ddea4' id='AwXwU-149' type='unavailable' to='qvagnu083x5-bl78@example.com/tYARglho'>
c2s55b17ae40d40                                         debug   Received[c2s]: <iq type='set' id='1hORO-3097' to='123456789@conference.example.com/448ddea4'>
c2s55b17ae40d40                                         debug   Sending[c2s]: <iq from='123456789@conference.example.com/448ddea4' type='error' id='1hORO-3097' to='focus@auth.example.com/focus32210095996901258'>

Let's take line #3 above for example.

Prosody IM printed Sending[c2s]: <presence from='123456789@conference.example.com/448ddea4' id='AwXwU-149' type='unavailable' to='tiqmjoyi7d3rr69-@example.com/9W3u-kLN'> .

However, the full XMPP message is:

<presence from='123456789@conference.example.com/448ddea4' id='AwXwU-149' to='tiqmjoyi7d3rr69-@example.com/9W3u-kLN' type='unavailable'
    xmlns='jabber:client'>
    <x
        xmlns='http://jabber.org/protocol/muc#user'>
        <item role='none' jid='qvagnu083x5-bl78@example.com/tYARglho' affiliation='none'/>
    </x>
</presence>

My problem is how can I optimize the logging configuration for Prosody IM to get fully detailed XMPP message as above.

And I have checked their documents:

  1. Advanced logging configuration
  2. Logging

Found nothing on this topic.

Thanks in advance.

hcnak
  • 428
  • 7
  • 18

1 Answers1

2

Well, I finally figured out how to log fully detailed XMPP message in Prosody IM.

You will need mod_stanza_debug to achieve this.

From Prosody IM website:

This module logs full stanzas to the debug log for the purposes of debugging.

It has been bundled in Prosody Installation. Just enable it by editing modules_enabled entry in Prosody global configuration file:

modules_enabled = {
        
        -- debug stanza
        "stanza_debug";

};

And finally , I can get the fully detailed XMPP message:

2021-09-01 12:10:51 c2s5577181821d0  debug    Sending[c2s]: <presence xmlns='jabber:client' from='123456789@conference.example.com/01f9f60c' to='jw5c6zuqagigmxyc@example.com/P2Z4rvii' id='Y81Xr-178'>
2021-09-01 12:10:51 c2s5577181821d0  debug    SEND: <presence xmlns='jabber:client' from='123456789@conference.example.com/01f9f60c' to='jw5c6zuqagigmxyc@example.com/P2Z4rvii' id='Y81Xr-178'><info os='l' v='13204'/><role role='participant'/><transcription-status status='OFF'/><nick xmlns='http://jabber.org/protocol/nick'>Transcriber</nick><stat name='version' value='Jigasi 1.1.SNAPSHOT'/><features xmlns='http://jabber.org/protocol/disco#info'><feature var='http://jitsi.org/protocol/jigasi'/><feature var='urn:xmpp:jingle:dtmf:0'/></features><c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://jitsi.org' ver='qo0cQuyj88ya15Au4O5PVYxqmqA='/><x xmlns='http://jabber.org/protocol/muc#user'><item affiliation='none' role='participant' jid='tfccagysjks6zjon@example.com/7XCp5aWX'/></x></presence>
2021-09-01 12:10:51 c2s557717e02950  debug    Sending[c2s]: <presence xmlns='jabber:client' from='123456789@conference.example.com/01f9f60c' to='focus@auth.example.com/focus32236264938572098' id='Y81Xr-178'>
2021-09-01 12:10:51 c2s557717e02950  debug    SEND: <presence xmlns='jabber:client' from='123456789@conference.example.com/01f9f60c' to='focus@auth.example.com/focus32236264938572098' id='Y81Xr-178'><info os='l' v='13204'/><role role='participant'/><transcription-status status='OFF'/><nick xmlns='http://jabber.org/protocol/nick'>Transcriber</nick><stat name='version' value='Jigasi 1.1.SNAPSHOT'/><features xmlns='http://jabber.org/protocol/disco#info'><feature var='http://jitsi.org/protocol/jigasi'/><feature var='urn:xmpp:jingle:dtmf:0'/></features><c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://jitsi.org' ver='qo0cQuyj88ya15Au4O5PVYxqmqA='/><x xmlns='http://jabber.org/protocol/muc#user'><item affiliation='none' role='participant' jid='tfccagysjks6zjon@example.com/7XCp5aWX'/></x></presence>
hcnak
  • 428
  • 7
  • 18
  • Thank you for the answer. can you tell how I can add stanza listener in Jicofo side for incoming xmpp messages from prosody – MMSmmsbd Jan 19 '22 at 10:40
  • @MMSmmsbd maybe you can do something like this : https://gist.github.com/ankanch/2fe307b97058ebcd8e582d1db28c9df3 . I only tested it on jigasi, not jicofo. – hcnak Jan 26 '22 at 11:25
  • Thank you, I'll check it out, I've added similar stanza listener in Jicofo xmpp , although there found presence stanzas, not all the IQ, or messages stanzas . – MMSmmsbd Jan 27 '22 at 04:05