ejabberd - Comments for "mod_service_log - logging received messages ?" https://www.ejabberd.im/node/650 en hi ! does your component is https://www.ejabberd.im/node/650#comment-2205 <p>hi !<br /> does your component is available in public domain ?</p> Tue, 05 Sep 2006 19:32:41 +0000 proforg comment 2205 at https://www.ejabberd.im Re: thanks a lot .. one small https://www.ejabberd.im/node/650#comment-1380 <div class="quote-msg"> <div class="quote-author"><em>badlop</em> wrote:</div> <p>I won't submit it for inclusion on ejabberd.</p></div> <p>thx..</p> <p>imo it is important, because otherwise i would receive 2 completely identical packets, altough only one message/iq/whatever was sent by a user...<br /> and it would be harder to prevent duplicate log entries..</p> <p>with the 'direction' information the only thing i need to do if i get two identical packets is to see if one is 'send' while the other is 'receive' and i can be sure that i can safely ignore one of them.</p> <p>without the 'direction' i would have to parse the JID to see if both are local users and just assume that i can ignore one of the two matching packets.</p> <p>... but anyway .. just my thoughts :)<br /> thx again<br /> Herbert Poul<br /> <noindex><a href="http://goim.us" title="http://goim.us" rel="nofollow" >http://goim.us</a></noindex></p> Wed, 15 Feb 2006 19:08:48 +0000 kahless@sphene.net comment 1380 at https://www.ejabberd.im Re: thanks a lot .. one small https://www.ejabberd.im/node/650#comment-1374 <div class="quote-msg"> <div class="quote-author"><em>kahless@sphene.net</em> wrote:</div> <p>do you think it would be possible to add a attribute or something to the XML which is sent by mod_service_log containing if the packet was received or sent ?</p></div> <p>It's possible, if you think that helps you. However, since I don't see this too much important, I won't submit it for inclusion on ejabberd.</p> <p>Here is the patch:</p> <pre>--- mod_service_log.erl (revisión: 507) +++ mod_service_log.erl (copia de trabajo) @@ -34,13 +34,13 @@ ok. log_user_send(From, To, Packet) -&gt; - log_packet(From, To, Packet, From#jid.lserver). + log_packet(From, To, Packet, From#jid.lserver, "send"). log_user_receive(_JID, From, To, Packet) -&gt; - log_packet(From, To, Packet, To#jid.lserver). + log_packet(From, To, Packet, To#jid.lserver, "recv"). -log_packet(From, To, {xmlelement, Name, Attrs, Els}, Host) -&gt; +log_packet(From, To, {xmlelement, Name, Attrs, Els}, Host, Direction) -&gt; Loggers = gen_mod:get_module_opt(Host, ?MODULE, loggers, []), ServerJID = #jid{user = "", server = Host, resource = "", luser = "", lserver = Host, lresource = ""}, @@ -54,6 +54,6 @@ ServerJID, #jid{user = "", server = Logger, resource = "", luser = "", lserver = Logger, lresource = ""}, - {xmlelement, "route", [], [FixedPacket]}) + {xmlelement, "route", [{"direction", Direction}], [FixedPacket]}) end, Loggers).</pre><p> With this patch, packets look like this:</p> <pre>&lt;route from='atenea' to='log.atenea' direction='send'&gt; &lt;iq from='badlop@atenea/Tka' to='atenea' id='16' type='get' xml:lang='es'&gt; ... &lt;/route&gt;</pre> Wed, 15 Feb 2006 10:23:56 +0000 mfoss comment 1374 at https://www.ejabberd.im thanks a lot .. one small https://www.ejabberd.im/node/650#comment-1373 <p>thanks a lot .. one small thing though .. do you think it would be possible to add a attribute or something to the XML which is sent by mod_service_log containing if the packet was received or sent ?</p> <p>this would make it a lot easier to prevent duplicated log entries because sender and receiver are on the same server.. which triggers two events ..</p> Tue, 14 Feb 2006 19:28:13 +0000 kahless@sphene.net comment 1373 at https://www.ejabberd.im Re: mod_service_log - logging received messages ? https://www.ejabberd.im/node/650#comment-1368 <div class="quote-msg"><div class="quote-author"><em>kahless@sphene.net</em> wrote:</div>i thought with mod_service_log it would be quite easy to accomplish .. but i'm only receiving messages sent from the jabber users on my server.. i don't receive messages which are received by them</div> <p>It seems a bug or misfeature in mod_service_log, reported on <a href="http://www.jabber.ru/bugzilla/show_bug.cgi?id=215">Bugzilla Bug 215 - mod_service_log logs only local messages</a>. There you will find a patch that hopefully fixes the problem.</p> Sun, 12 Feb 2006 21:36:57 +0000 mfoss comment 1368 at https://www.ejabberd.im Re: Doesn't Bandersnatch store https://www.ejabberd.im/node/650#comment-1366 <div class="quote-msg"> <div class="quote-author"><em>badlop</em> wrote:</div> <p>Doesn't Bandersnatch store all messages on a database?</p></div> <p>well .. it uses the same module (mod_service_log) .. and the module seams to transmit only packets sent by users on the server.. not received by them ..<br /> that's the problem ....</p> <p>(as i said in the later post .. i've tried bandersnatch before... actually i wondered why it would only store sent packets .. so i made a small 5 line component in perl which outputs everything it receives.. and.. packets received by users on the servers aren't transmitted to the component ....)</p> Sun, 12 Feb 2006 13:33:35 +0000 kahless@sphene.net comment 1366 at https://www.ejabberd.im Doesn't Bandersnatch store https://www.ejabberd.im/node/650#comment-1364 <p>Doesn't Bandersnatch store all messages on a database?</p> Sun, 12 Feb 2006 10:14:01 +0000 mfoss comment 1364 at https://www.ejabberd.im ... altough it seams quite https://www.ejabberd.im/node/650#comment-1363 <p>... altough it seams quite odd .. since the source code of mod_service_log is:</p> <p>start(Host, _Opts) -&gt;<br /> ejabberd_hooks:add(user_send_packet, Host,<br /> ?MODULE, log_user_send, 50),<br /> ejabberd_hooks:add(user_receive_packet, Host,<br /> ?MODULE, log_user_receive, 50),<br /> ok.</p> <p>log_user_send(From, To, Packet) -&gt;<br /> log_packet(From, To, Packet).</p> <p>log_user_receive(_JID, From, To, Packet) -&gt;<br /> log_packet(From, To, Packet).</p> <p>i have no idea about rebol .. nor about ejabberd's inner workings.. but if i understand it correctly .. it registers a hook for send and receive.. and handles them the same way ..</p> <p>but i'm 100% certain i'm only receiving packets which were sent by users of the server. not one packet which was receceived by a user on my ejabberd server was transmitted to my small test component (neither to bandersnatch which i tried before)</p> <p>any ideas ?</p> Sat, 11 Feb 2006 22:50:54 +0000 kahless@sphene.net comment 1363 at https://www.ejabberd.im