| This page (and all pages in the Tech: namespace) is a developer discussion about a feature that is either proposed for inclusion in JAMWiki or one that has already been implemented. This page is NOT documentation of JAMWiki functionality - for a list of documentation, see Category:JAMWiki.
Status of this feature: IMPLEMENTED. This functionality was included in JAMWiki 0.8.0.
|
| Contents |
|---|
Mediawiki offers a Special:Logs page that contains information about user registration, imports, user blocks, etc. JAMWiki should at a minimum offer log capability, and ideally offer all the features of Mediawiki's implementation including integration with Special:RecentChanges.
Logs will need to be stored in a separate table, and the jam_recent_change will likely also need to be modified to display log information. A schema for the new table will likely look something like the following:
CREATE TABLE jam_log ( \
log_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, \
virtual_wiki_id INTEGER NOT NULL, \
wiki_user_id INTEGER, \
display_name VARCHAR(200) NOT NULL, \
topic_id INTEGER, \
topic_version_id INTEGER, \
log_type INTEGER NOT NULL, \
log_comment VARCHAR(200), \
log_params VARCHAR(500), \
CONSTRAINT jam_f_log_wuser FOREIGN KEY (wiki_user_id) REFERENCES jam_wiki_user(wiki_user_id), \
CONSTRAINT jam_f_log_topic_ver FOREIGN KEY (topic_version_id) REFERENCES jam_topic_version(topic_version_id), \
CONSTRAINT jam_f_log_topic FOREIGN KEY (topic_id) REFERENCES jam_topic(topic_id), \
CONSTRAINT jam_f_log_vwiki FOREIGN KEY (virtual_wiki_id) REFERENCES jam_virtual_wiki(virtual_wiki_id) \
)
All of these fields should be self-explanatory except for possibly log_params which would contain delimited parameters specific to each log type. For example, the move log might contain something like "original_topic_name|new_topic_name" so that the original and destination topics for the move are available for parsing into log messages, etc. This code is still a work-in-progress.
revision 2667 adds code to create the jam_log table and to populate it with a record after a move, import, deletion, file upload, or user account creation. The Special:Logs page does not yet exist, but I've got code for that working locally, it just needs a bit more cleanup. Additional TODO items include integrating with Special:RecentChanges, adding ability to populate/reload this table for existing installations, fixing some issues with import logging (it logs too many records), adding logging for permission changes, and fixing the formatting of log display & messages. I expect that most of this work should be done and committed in the next 1-2 weeks. -- Ryan • (comments) • 14-Aug-2009 08:11 PDT
At this point I'm mostly happy with the state of the logging code and ready to push it out for wider beta testing. Special:Log provides an overview of the available functionality, and the code integrates fairly nicely with Special:RecentChanges. There may be a few odd corner-cases during mass reloads using the Special:Maintenance tools, but those can be fixed as they are found. -- Ryan • (comments) • 03-Oct-2009 10:56 PDT