
	MOD MUC LOG XML
	===============

	Patch for ejabberd 1.1.2 or 1.1.3
	22 October 2006



  HOW TO INSTALL
  --------------

1. Copy modmuclogxml.diff to the ejabberd 1.1.2 source directory.

2. Apply the patch:
patch -p0<modmuclogxml.diff

3. Compile ejabberd

4. Configure ejabberd on ejabberd.cfg

5. Start ejabberd


  CONFIGURATION
  -------------

This patch adds or modifies several options for mod_muc_log:

 * logformat
Logs can be stored in two different formats: html or xml.
The format of the logs is specified on ejabberd.cfg for all chatrooms:
Allowed values: html, xml
Default value: html

 * dirtype
Allowed values: subdirs, plain, {custom, "%C/%Y-%M-%D"}
If custom is selected, a string must be introduced, that can include directories and be templated:
%C will be replaced with the chatroom JID, %Y by the year, %M the month and %D the day.
If custom is selected and the provided string does not include %C, all chatrooms will be logged to the same file,
and therefore the roomjid will be indicated as an attribute of each event.
Default value: subdirs

 * event_time_format
Defines the format of the 'time' attribute on events. 
Allowed values are: original, iso, gregorian and unixtime
Examples:
  original: 13:44:51
  iso: 20061016T13:44:51
  gregorian: 63328225653 It is 'the number of gregorian seconds
    starting with year 0 and ending at the given date and time.'
  unixtime: 1161007136 It is the standard unix timestamp: seconds
    since 1 Jan 1970.
Default value: original

Example configuration:
{modules,
 [
  ...
  {mod_muc_log,    [{access_log, muc_admin},
                    {logformat, xml},
                    {dirtype, {custom, "%C/%Y/%M-%D"}},
                    {event_time_format, unixtime}
                   ]},
  ...
 ]
}.


  RESTRICTIONS
  ------------

 * Logs will be stored only in one format, either html or xml, but 
   not on both formats at the same time.

 * Format of logs will not be configurable per chatroom, only on ejabberd.cfg

 * mod_muc_log does not log private messages sent from a participant 
   privately to another participant. It only logs messages sent by
   participants to the room.

 * Each morning, a new file is created, and the log file of yesterday 
   is closed (</xml> is appended). This means that the XML file of 
   'today' is not XML well-formatted until tomorrow. This also means 
   that if some days there is no activity, the xml tag will not be 
   closed.
