hi,
i would like to write a small component which logs all sent and received messages into a postgresql database ..
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 ..
is it possible to configure mod_service_log to also transmit received messages ?
i guess if i had a clue about rebol i could just modify mod_logxml to store the messages in a database.. but.. i haven't .. and .. i would like to have
the messages real time in my database, and not parse the .xml file in a cronjob ...
thanks,
Herbert Poul
... altough it seams quite
... altough it seams quite odd .. since the source code of mod_service_log is:
start(Host, _Opts) ->
ejabberd_hooks:add(user_send_packet, Host,
?MODULE, log_user_send, 50),
ejabberd_hooks:add(user_receive_packet, Host,
?MODULE, log_user_receive, 50),
ok.
log_user_send(From, To, Packet) ->
log_packet(From, To, Packet).
log_user_receive(_JID, From, To, Packet) ->
log_packet(From, To, Packet).
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 ..
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)
any ideas ?
Doesn't Bandersnatch store
Doesn't Bandersnatch store all messages on a database?
Re: Doesn't Bandersnatch store
Doesn't Bandersnatch store all messages on a database?
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 ..
that's the problem ....
(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 ....)
Re: mod_service_log - logging received messages ?
It seems a bug or misfeature in mod_service_log, reported on Bugzilla Bug 215 - mod_service_log logs only local messages. There you will find a patch that hopefully fixes the problem.
thanks a lot .. one small
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 ?
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 ..
Re: thanks a lot .. one small
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 ?
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.
Here is the patch:
With this patch, packets look like this:
Re: thanks a lot .. one small
I won't submit it for inclusion on ejabberd.
thx..
imo it is important, because otherwise i would receive 2 completely identical packets, altough only one message/iq/whatever was sent by a user...
and it would be harder to prevent duplicate log entries..
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.
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.
... but anyway .. just my thoughts :)
http://goim.us
thx again
Herbert Poul
hi ! does your component is
hi !
does your component is available in public domain ?