I have the same problem. I basically want to record group chats and random p2p chats, preferably in mysql. I found a module that does mysql logging, but it needs to be fixed and recompiled, and I don't know if it will be supported in the future: http://www.dp.uz.gov.ua/o.palij/mod_logdb/
There are other mods (e.g. mod_muc_log). Try to find ejabberd.im
If ejabberd is programmed (as in my case), another option will automatically include a bot entry in every conversation.
I think I will start with the 1st solution.
source share