Logging table

From MediaWiki.org

Jump to: navigation, search
Manual:Contents MediaWiki database layout Logging table



MediaWiki version: 1.5

New to version 1.5.

DESCRIBE logging; results in:

+---------------+------------------+------+-----+----------------+-------+
| Field         | Type             | Null | Key | Default        | Extra |
+---------------+------------------+------+-----+----------------+-------+
| log_type      | char(10)         | NO   | MUL |                |       |
| log_action    | char(10)         | NO   |     |                |       |
| log_timestamp | char(14)         | NO   |     | 19700101000000 |       |
| log_user      | int(10) unsigned | NO   | MUL | 0              |       |
| log_namespace | int(11)          | NO   | MUL | 0              |       |
| log_title     | varchar(255)     | NO   |     |                |       |
| log_comment   | varchar(255)     | NO   |     |                |       |
| log_params    | blob             | NO   |     |                |       |
+---------------+------------------+------+-----+----------------+-------+

The content of this table is basically what you see on the Special:Log page.

log_type
The type of the log action, or the "log type". You can filter by this type on Special:Log. Typical values are: block, delete, import, makebot, move, newusers, protect, renameuser, rights, upload
log_action
The action performed. There may be multiple actions possible for a given type: for example, an entry with the type delete may have the action delete or restore, etc. Typical values are: upload, delete, protect, block, unprotect, restore, unblock, rights, move, move_redir, renameuser, newusers, create, create2, grant, interwiki, revoke
log_timestamp
the time the action was performed, in the timestamp format MediaWiki uses everywhere in the database: yyyymmddhhmmss
log_user
the id of the user who performed the action. This is a reference into the user table
log_namespace
the namespace of the affected page. Together with log_title, this is a reference into the page table
Note: logging table may contain rows with log_namespace < 0:
  • Special:Renameuser with log_type and log_action being either "" or "renameuser"
  • Special:Userlogin with log_type and log_action being "newusers"
log_title
the title of the affected page. Together with log_namespace, this is a reference into the page table
log_comment
the comment given for the action; that is the upload comment for uploads, the deletion comment for deletions, etc
log_params
additional parameters, usually empty. For user blocks, this contains the duration of the block, in human readable form. For page moves, this contains the location the page was moved to.
MediaWiki version: 1.10 and after
log_id
primary key for the table.
MediaWiki version: 1.8

DESCRIBE logging; in MediaWiki 1.8 results in:

+---------------+------------------+------+-----+----------------+-------+
| Field         | Type             | Null | Key | Default        | Extra |
+---------------+------------------+------+-----+----------------+-------+
| log_type      | char(10)         | NO   | MUL | NULL           |       |
| log_action    | char(10)         | NO   |     | NULL           |       |
| log_timestamp | char(14)         | NO   | MUL | 19700101000000 |       |
| log_user      | int(10) unsigned | NO   | MUL | 0              |       |
| log_namespace | int(11)          | NO   | MUL | 0              |       |
| log_title     | varchar(255)     | NO   |     | NULL           |       |
| log_comment   | varchar(255)     | NO   |     | NULL           |       |
| log_params    | blob             | NO   |     | NULL           |       |
+---------------+------------------+------+-----+----------------+-------+


MediaWiki version: 1.9
+---------------+------------------+------+-----+----------------+-------+
| Field         | Type             | Null | Key | Default        | Extra |
+---------------+------------------+------+-----+----------------+-------+
| log_type      | char(10)         | NO   | MUL | NULL           |       |
| log_action    | char(10)         | NO   |     | NULL           |       |
| log_timestamp | char(14)         | NO   | MUL | 19700101000000 |       |
| log_user      | int(10) unsigned | NO   | MUL | 0              |       |
| log_namespace | int(11)          | NO   | MUL | 0              |       |
| log_title     | varchar(255)     | NO   |     | NULL           |       |
| log_comment   | varchar(255)     | NO   |     | NULL           |       |
| log_params    | blob             | NO   |     | NULL           |       |
+---------------+------------------+------+-----+----------------+-------+


MediaWiki version: 1.10
+---------------+------------------+------+-----+----------------+----------------+
| Field         | Type             | Null | Key | Default        | Extra          |
+---------------+------------------+------+-----+----------------+----------------+
| log_type      | char(10)         | NO   | MUL | NULL           |                |
| log_action    | char(10)         | NO   |     | NULL           |                |
| log_timestamp | char(14)         | NO   | MUL | 19700101000000 |                |
| log_user      | int(10) unsigned | NO   | MUL | 0              |                |
| log_namespace | int(11)          | NO   | MUL | 0              |                |
| log_title     | varchar(255)     | NO   |     | NULL           |                |
| log_comment   | varchar(255)     | NO   |     | NULL           |                |
| log_params    | blob             | NO   |     | NULL           |                |
| log_id        | int(10) unsigned | NO   | PRI | NULL           | auto_increment |
+---------------+------------------+------+-----+----------------+----------------+


MediaWiki version: 1.11
+---------------+---------------------+------+-----+----------------+----------------+
| Field         | Type                | Null | Key | Default        | Extra          |
+---------------+---------------------+------+-----+----------------+----------------+
| log_type      | varbinary(10)       | NO   | MUL | NULL           |                |
| log_action    | varbinary(10)       | NO   |     | NULL           |                |
| log_timestamp | binary(14)          | NO   | MUL | 19700101000000 |                |
| log_user      | int(10) unsigned    | NO   | MUL | 0              |                |
| log_namespace | int(11)             | NO   | MUL | 0              |                |
| log_title     | varchar(255)        | NO   |     | NULL           |                |
| log_comment   | varchar(255)        | NO   |     | NULL           |                |
| log_params    | blob                | NO   |     | NULL           |                |
| log_id        | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
| log_deleted   | tinyint(3) unsigned | NO   |     | 0              |                |
+---------------+---------------------+------+-----+----------------+----------------+


MediaWiki version: 1.12
+---------------+---------------------+------+-----+----------------+----------------+
| Field         | Type                | Null | Key | Default        | Extra          |
+---------------+---------------------+------+-----+----------------+----------------+
| log_type      | char(10)            | NO   | MUL | NULL           |                |
| log_action    | char(10)            | NO   |     | NULL           |                |
| log_timestamp | char(14)            | NO   | MUL | 19700101000000 |                |
| log_user      | int(10) unsigned    | NO   | MUL | 0              |                |
| log_namespace | int(11)             | NO   | MUL | 0              |                |
| log_title     | varchar(255)        | NO   |     | NULL           |                |
| log_comment   | varchar(255)        | NO   |     | NULL           |                |
| log_params    | blob                | NO   |     | NULL           |                |
| log_id        | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
| log_deleted   | tinyint(3) unsigned | NO   |     | 0              |                |
+---------------+---------------------+------+-----+----------------+----------------+
Personal tools