mod_log_chat - log chat messages in text files

Name: mod_log_chat
Purpose: Log 2 ways chat messages in files
Author: Jérôme Sautret (jsautret)
Type: Module
Requirements: ejabberd 2.0.0 or newer. To use with ejabberd 1.1.x read bellow
Download: ejabberd-modules

mod_log_chat is a ejabberd module aimed at logging chat messages in text files. mod_log_chat create one file per couple of chatters and per day (it doesn't log muc messages, use mod_muc_log for this).

It can store messages in plain text or HTML format.

This module can be used with ejabberd 1.1.x if you delete all the lines that say '?DEBUG(...)'

Alternatively, there is an experimental fork for MySQL5, see mod_log_chat_mysql5.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

mod_log_chat - log chat

I have compiled mod_log_chat.erl copied it to the target directory with *.beam for ejabberd. Added to ejabberd.yml

  mod_log_chat:
    path: "/var/log/ejabberd/chat"
    format: html

but still have next problem^

2014-12-19 14:19:24.664 [critical] <0.37.0>@gen_mod:start_module:90 Problem starting the module mod_log_chat for host <<"192.168.7.101">>
options: [{path,<<"/var/log/ejabberd/chat">>},{format,html}]
error: undef
[{ejabberd_logger,debug_msg,
                  [mod_log_chat,31," ~p  ~p~n",
                   [<<"192.168.7.101">>,
                    [{path,<<"/var/log/ejabberd/chat">>},{format,html}]]],
                  []},
{mod_log_chat,start,2,[{file,"src/mod_log_chat.erl"},{line,31}]},
{gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,82}]},
{lists,foreach,2,[{file,"lists.erl"},{line,1336}]},
{ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,67}]},
{application_master,start_it_old,4,
                     [{file,"application_master.erl"},{line,272}]}]
2014-12-19 14:19:24.664 [critical] <0.37.0>@gen_mod:start_module:95 ejabberd initialization was aborted because a module start failed.

performance

Hi there! Just want to ask how this module performs? Say, >50,000 users chatting? How disk heavy would this be at that scale?

Also, is there a config to set an expiry date for the files? Thanks.

nvm

Changed my mind, I'm gonna implement my own using a database back end instead of text files.

problem with installation

Running on Gentoo Linux
EJabber 1.1.4
Again and again module crashed with

=ERROR REPORT==== 2007-12-06 17:06:48 ===
E(<0.38.0>:gen_mod:47): {undef,
[{ejabberd_logger,
debug_msg,
[mod_log_chat,
31,
“ ~p ~p~n”,
["taber.ru",
[{path,"/var/log/jabber/chat"},
{format,html}]]]},
{mod_log_chat,start,2},
{gen_mod,start_module,3},
{lists,foreach,2},
{ejabberd_app,start,2},
{application_master,start_it_old,4}]}

Please, any ideas? Very need for this module at this installation…

-pa /usr/lib/erlang/lib/ejabberd-1.1.4/ebin
I moved mod_log_chat.beam here /usr/lib/erlang/lib/ejabberd-1.1.4/ebin, all other modules work, but this...
I compile it with erlang 11.2.5

The answer is in this very

The answer is in this very same page. Please look at the other people that asked here about this module.

If you meaned "The problem

If you meaned "The problem seems that Erlang couldn't find the file mod_log_chat.beam"? I checked -pa again and again as I write above (sorry for bad English, it's not my native language), but it's not solutions of the problem.I copied some other .beams into that directory and modules works! But log_chat crashed.

Remove ?DEBUG lines

The problem seems that the module is prepared for ejabberd 2.0.0. Fortunately, you can use it in your 1.1.4: delete all the lines that say ?DEBUG(...)

chat log

plz if anyone can tell me the process/configration how to log the users chat in internal database.if internal database is not supported then tell me the other way.

plz tell me where i have to edit

undef,[{ejabberd_logger

=ERROR REPORT==== 2007-11-14 12:15:08 ===
E(<0.644.0>:gen_mod:47): {undef,[{ejabberd_logger,
debug_msg,
[mod_log_chat,
31,
" ~p ~p~n",
["my.hostname.hidden",
[{path,"/var/log/ejabberd/chat"},
{format,html}]]]},
{mod_log_chat,start,2},
{gen_mod,start_module,3},
{lists,foreach,2},
{ejabberd_app,start,2},
{application_master,start_it_old,4}]}

I get this message in FreeBSD 6.2
Compiled without any errors. I use ejabberd from ports.

prob

Detergent wrote:

=ERROR REPORT==== 2007-11-14 12:15:08 ===
E(<0.644.0>:gen_mod:47): {undef,[{ejabberd_logger,
debug_msg,
[mod_log_chat,
31,
" ~p ~p~n",
["my.hostname.hidden",
[{path,"/var/log/ejabberd/chat"},
{format,html}]]]},
{mod_log_chat,start,2},
{gen_mod,start_module,3},
{lists,foreach,2},
{ejabberd_app,start,2},
{application_master,start_it_old,4}]}

I get this message in FreeBSD 6.2
Compiled without any errors. I use ejabberd from ports.

Removing ?DEBUG lines solves the problem but is not a solution ;/

Error after installing mod_log_chat

I tried to install this module. Compiling went well, I put the beam file to /var/lib/ejabberd/ebin/ since there werent any other beam files on my system. (README.txt just says: Put the beam file where your other beam files are - wtf? Can't it tell me how to determine/set the correct path...). When I change ejabberd.conf accourding to the example configuration and restart ejabberd, I get the following error in the log file:

=ERROR REPORT==== 2007-11-10 18:37:34 ===
E(<0.1123.0>:gen_mod:47): {undef,[{mod_log_chat,
                                      start,
                                      ["jabber.perlplexity.org",[]]},
                                  {gen_mod,start_module,3},
                                  {lists,foreach,2},
                                  {ejabberd_app,start,2},
                                  {application_master,start_it_old,4}]

That is not very helpfull for me, I can't even figure out what went wrong... If anyone could help me I would be pleased.

Thank you,
Timo

Copied to wrong directory, check -pa

timos wrote:

I put the beam file to /var/lib/ejabberd/ebin/ since there werent any other beam files on my system. (README.txt just says: Put the beam file where your other beam files are - wtf? Can't it tell me how to determine/set the correct path...).

The correct path is different depending on how you installed ejabberd: source code package, binary installer, CEAN, or a specific Operating System package.

When compiled from the source code package, 'make install' copies ejabberd beam files to the path you mentioned. But a brief tutorial can't contain all the possibilities, hence it relies in the administrator knowledge of where the files where installed in his system.

Maybe this helps: when starting ejabberd, the parameters -pa or -pz are used to indicate that directory, for example:

erl -s ejabberd -pa /var/lib/ejabberd/ebin ...
timos wrote:

When I change ejabberd.conf accourding to the example configuration and restart ejabberd, I get the following error in the log file:

=ERROR REPORT==== 2007-11-10 18:37:34 ===
E(<0.1123.0>:gen_mod:47): {undef,[{mod_log_chat,
                                      start,
                                      ["jabber.perlplexity.org",[]]},
                                  {gen_mod,start_module,3},
                                  {lists,foreach,2},
                                  {ejabberd_app,start,2},
                                  {application_master,start_it_old,4}]

That is not very helpfull for me, I can't even figure out what went wrong... If anyone could help me I would be pleased.

The problem seems that Erlang couldn't find the file mod_log_chat.beam . So you must follow the instructions: find where are all the other ejabberd beam files, and copy this file there.

mod_log_chat log file name is incompliant with Windows

Default log file name has the template in style of:
2007-01-16 user1@site1 <-> user2@site2.log

Since symbols < and > are invalid symbols for windows file names - such file can't be created and mod_log_chat would produce io error
("E(<0.372.0>:mod_log_chat:171): Cannot write into file ./2007-01-16 user1@site1 <-> user2@site2.log: eio"

Possible resolution could be replacement of format string from
"~s/~~p-~~2.2.0w-~~2.2.0w ~s <-> ~s~s" to something like
"~s/~~p-~~2.2.0w-~~2.2.0w ~s --- ~s~s" in mod_chat_log.erl:126

Alex Pinsker
http://alexpinsker.blogspot.com

Fixed

Thanks for the report. It's fixed now.

exclude list

it would be great if there was a exclude list of jids that sould not be logged.

Hi Is possible to exclude

Hi

Is possible to exclude jids using mod_log_chat.

Could you please confirm.

Your help is highly appreciated

Thanks

Krishna

Or maybe the choice between

Or maybe the choice between an exclude list or an include list ?

--
Mickaël Rémond
Process-one

yes both lists would be good

yes both lists would be good idea i think. btw: is there any chance that mod_archive will support sql backend. I would be great feature for many users...

Yes, having a version of the

Yes, having a version of the mod_archive that supports relational database makes sense for large servers.
No promise on when it will be available, though.

--
Mickaël Rémond
Process-one

Log Chat history - Specific Users

Hi,

I am have ejabberd with version 2.1.9.

I want to store all Users chat history except some one.

Is possible to implement this..

Please confirm

Your help is highly appreciated.

Thanks
GK

Syndicate content