Manual:logging テーブル

This page is a translated version of the page Manual:Logging table and the translation is 49% complete.
Manual:コンテンツ MediaWiki のデータベース レイアウト logging テーブル
MediaWiki バージョン:
1.4

MediaWiki におけるすべての操作記録は logging テーブルに記録されます。 利用者は少数の制限されたログ(Special:Log/suppress 等)を除いて Special:Log においてこれらの編集を閲覧することができます。

このテーブルの内容は Special:Log ページで表示されるものです。 例:

  • 14:18, 25 June 2008 Jacksprat (Talk | contribs| block) uploaded "Image:Climb.jpg" (Added this image for the climbing page)

フィールド

log_id

MediaWiki バージョン:
1.10

このテーブルの主キーです。 rc_logid はこのカラムにリンクしている外部キーです。

log_type

操作の種類です。

Special:Log (すべての公開ページ) では、この種類の値を使って絞りこむことができます。

rc_log_type に相当します。

Example values from some Wikimedia wikis are as follows (including now-obsolete logs and several extensions):

  • abusefilter
  • block
  • close
  • contentmodel
  • delete
  • gblblock
  • gblrights
  • globalauth
  • gwtoolset
  • import
  • liquidthreads
  • lock
  • managetags
  • massmessage
  • merge
  • move
  • mwoauthconsumer
  • newsletter
  • newusers
  • notifytranslators
  • pagelang
  • pagetranslation
  • patrol
  • protect
  • renameuser
  • review
  • rights
  • spamblacklist
  • tag
  • thanks
  • timedmediahandler
  • translationreview
  • upload
  • usermerge

log_action

行われた操作。 与えられた「操作の種類」に対して複数の「操作」が該当することもあります。例えば、"delete"(削除)という「操作の種類」には、"delete"(ページの削除)や "restore"(ページの復元)などが含まれます。 rc_log_action に相当します。 API:記録項目 も参照してください。 Manual:操作の記録 を参照してください。

log_timestamp

The time the action was performed, in the timestamp format MediaWiki uses everywhere in the database: yyyymmddhhmmss ("14:18, 25 June 2008" in example). Has the same value as the corresponding recentchanges.rc_timestamp and revision.rev_timestamp. Does not necessarily have the same value as the corresponding image.img_timestamp, in the case of file uploads.

log_user

MediaWiki バージョン:
1.33

操作を行った利用者の id 。 これは、user テーブルへの参照です。 rc_user rev_user に相当します。

Deprecated in favor of log_actor.

log_user_text

MediaWiki バージョン:
1.16

user_name of the user who performed the action, intended primarily for anonymous users, fillable by maintenance/populateLogUsertext.php. rc_user_text rev_user_text に相当します。

Deprecated in favor of log_actor.

log_actor

MediaWiki バージョン:
1.31
Gerrit change 380669

This is a foreign key to actor_id in the actor table, corresponding to the user (registered or anonymous) who performed the action.

log_namespace

影響を受けたページの名前空間Together with log_title, this is a reference into the page table ("Image:Climb.jpg" in example). rc_namespace に相当します。

logging テーブルの log_namespace には 0 未満の数値が入ることがあります:
  • log_type と log_action が "" か "renameuser" である、特別:利用者名変更。
  • log_type が "newusers"であり、log_action が "create" などである、特別:ログイン。

log_title

影響を受けたページの title 。 log_namespace とともに、page テーブルへの参照となります。 rc_title に相当します。

The title is also known as the log entry's 'target'.

ブロック記録の場合、ここにはブロックされた利用者名が入ります。 For thanks action, this is the thanked user's username.

log_page

MediaWiki バージョン:
1.16

The page_id that this log action is about. rc_cur_id rev_page に相当します。 In the case of a page move, this is set to the page_id of the moved page (since Gerrit change 157872). Formerly, it was the page_id of the redirect, or 0 if the page was moved without creating a redirect.

log_comment

MediaWiki バージョン:
1.32

その操作に与えられた要約。これは、アップロードの際の要約、削除の際の要約などです。 rc_comment rev_comment に相当します。

(廃止予定); log_comment_id および comment テーブルを代わりに使用すべきです。

log_comment_id

MediaWiki バージョン:
1.30

This is a foreign key to comment_id in the comment table.

log_params

MediaWiki バージョン:
1.5

Additional parameters, usually empty. Mirrored in rc_params . log_params is usually serialized, but not always; sometimes, for historical reasons, fields for log_params are separated by a newline. Anyone creating a new log type should use the PHP serialization.

For user blocks, log_params contains the duration of the block and other data, in human readable form, e.g. "2 weeks nocreate,noautoblock,noemail". For page moves, it contains a serialized array of the prefixed page title the page was moved to (i.e. in FULLPAGENAME format) and the boolean value of noredir. For other examples, see Manual:Log parameters .

MediaWiki バージョン:
1.19

Since 1.19, data in log_params is in a different format. For instance, if you want to filter patrol/patrol log entries excluding autopatrol, pre-1.19 log entries need:

log.log_params LIKE '%\n0'

while entries added in 1.19 and further need (serialized PHP arrays):

log.log_params LIKE '%"6::auto";i:0%'
MediaWiki バージョン:
1.21

Since 1.21 , log_params is always serialized for newusers log too. An entry now looks like:

mysql> select log_params, log_action from logging where log_user = 4681690;
+----------------------------------+------------+
| log_params                       | log_action |
+----------------------------------+------------+
| a:1:{s:9:"4::userid";i:4681690;} | autocreate |
+----------------------------------+------------+

while it used to look like:

mysql> select log_params, log_action from logging where log_user = 2298743;
+------------+------------+
| log_params | log_action |
+------------+------------+
| 2298743    | autocreate |
+------------+------------+

The numbers, e.g. the 4 in "4::userid", are used as the argument number for message keys (e.g. $1, $2,...). The numbering should start with number 4, as the first three parameters are hardcoded for every message. If there is no message key, then a number should not be used. Some data contained in log_params are also contained in log_search to facilitate indexed queries. Log parameters are typically set using functions such as ManualLogEntry::setParameters() and LogPage::addEntry() .

log_deleted

MediaWiki バージョン:
1.10

版指定削除 機能を使って削除された記録の情報。 rc_deleted rev_deleted に相当します。 It is a bit field. Take the sum of the following to determine what it represents:

  • 1 Action deleted
  • 2 Comment deleted
  • 4 User deleted
  • 8 If the deleted information is restricted. If this field is not set, then only deletedhistory right is needed, otherwise you need suppressrevision right. (On Wikimedia wikis, this corresponds to if admins can view the entry, or if only oversighters can)

For example, if the value is 6 (4+2), then the action would be visible, but the comment and user would not be unless you had deletedhistory rights.

スキーマの要約

MediaWiki バージョン:
1.34

DESCRIBE logging;

+----------------+---------------------+------+-----+----------------+----------------+
| Field          | Type                | Null | Key | Default        | Extra          |
+----------------+---------------------+------+-----+----------------+----------------+
| log_id         | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
| log_type       | varbinary(32)       | NO   | MUL |                |                |
| log_action     | varbinary(32)       | NO   |     |                |                |
| log_timestamp  | binary(14)          | NO   | MUL | 19700101000000 |                |
| log_actor      | bigint(20) unsigned | NO   | MUL | NULL           |                |
| log_namespace  | int(11)             | NO   | MUL | 0              |                |
| log_title      | varbinary(255)      | NO   |     |                |                |
| log_page       | int(10) unsigned    | YES  | MUL | NULL           |                |
| log_comment_id | bigint(20) unsigned | NO   |     | NULL           |                |
| log_params     | blob                | NO   |     | NULL           |                |
| log_deleted    | tinyint(3) unsigned | NO   |     | 0              |                |
+----------------+---------------------+------+-----+----------------+----------------+
MediaWiki バージョン:
1.33

DESCRIBE logging;

+----------------+---------------------+------+-----+----------------+----------------+
| Field          | Type                | Null | Key | Default        | Extra          |
+----------------+---------------------+------+-----+----------------+----------------+
| log_id         | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
| log_type       | varbinary(32)       | NO   | MUL |                |                |
| log_action     | varbinary(32)       | NO   |     |                |                |
| log_timestamp  | binary(14)          | NO   | MUL | 19700101000000 |                |
| log_user       | int(10) unsigned    | NO   | MUL | 0              |                |
| log_user_text  | varbinary(255)      | NO   | MUL |                |                |
| log_actor      | bigint(20) unsigned | NO   | MUL | 0              |                |
| log_namespace  | int(11)             | NO   | MUL | 0              |                |
| log_title      | varbinary(255)      | NO   |     |                |                |
| log_page       | int(10) unsigned    | YES  | MUL | NULL           |                |
| log_comment_id | bigint(20) unsigned | NO   |     | NULL           |                |
| log_params     | blob                | NO   |     | NULL           |                |
| log_deleted    | tinyint(3) unsigned | NO   |     | 0              |                |
+----------------+---------------------+------+-----+----------------+----------------+
MediaWiki バージョン:
1.31 – 1.32

DESCRIBE logging;

+----------------+---------------------+------+-----+----------------+----------------+
| Field          | Type                | Null | Key | Default        | Extra          |
+----------------+---------------------+------+-----+----------------+----------------+
| log_id         | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
| log_type       | varbinary(32)       | NO   | MUL |                |                |
| log_action     | varbinary(32)       | NO   |     |                |                |
| log_timestamp  | binary(14)          | NO   | MUL | 19700101000000 |                |
| log_user       | int(10) unsigned    | NO   | MUL | 0              |                |
| log_user_text  | varbinary(255)      | NO   | MUL |                |                |
| log_actor      | bigint(20) unsigned | NO   | MUL | 0              |                |
| log_namespace  | int(11)             | NO   | MUL | 0              |                |
| log_title      | varbinary(255)      | NO   |     |                |                |
| log_page       | int(10) unsigned    | YES  | MUL | NULL           |                |
| log_comment    | varbinary(767)      | NO   |     |                |                |
| log_comment_id | bigint(20) unsigned | NO   |     | 0              |                |
| log_params     | blob                | NO   |     | NULL           |                |
| log_deleted    | tinyint(3) unsigned | NO   |     | 0              |                |
+----------------+---------------------+------+-----+----------------+----------------+
MediaWiki バージョン:
1.30

DESCRIBE logging;

+----------------+---------------------+------+-----+----------------+----------------+
| Field          | Type                | Null | Key | Default        | Extra          |
+----------------+---------------------+------+-----+----------------+----------------+
| log_id         | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
| log_type       | varbinary(32)       | NO   | MUL |                |                |
| log_action     | varbinary(32)       | NO   |     |                |                |
| log_timestamp  | binary(14)          | NO   | MUL | 19700101000000 |                |
| log_user       | int(10) unsigned    | NO   | MUL | 0              |                |
| log_user_text  | varbinary(255)      | NO   | MUL |                |                |
| log_namespace  | int(11)             | NO   | MUL | 0              |                |
| log_title      | varbinary(255)      | NO   |     |                |                |
| log_page       | int(10) unsigned    | YES  | MUL | NULL           |                |
| log_comment    | varbinary(767)      | NO   |     |                |                |
| log_comment_id | bigint(20) unsigned | NO   |     | 0              |                |
| log_params     | blob                | NO   |     | NULL           |                |
| log_deleted    | tinyint(3) unsigned | NO   |     | 0              |                |
+----------------+---------------------+------+-----+----------------+----------------+
MediaWiki バージョン:
1.25 – 1.29

DESCRIBE logging;

+---------------+---------------------+------+-----+----------------+----------------+
| Field         | Type                | Null | Key | Default        | Extra          |
+---------------+---------------------+------+-----+----------------+----------------+
| log_id        | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
| log_type      | varbinary(32)       | NO   | MUL |                |                |
| log_action    | varbinary(32)       | NO   |     |                |                |
| log_timestamp | binary(14)          | NO   | MUL | 19700101000000 |                |
| log_user      | int(10) unsigned    | NO   | MUL | 0              |                |
| log_user_text | varbinary(255)      | NO   | MUL |                |                |
| log_namespace | int(11)             | NO   | MUL | 0              |                |
| log_title     | varbinary(255)      | NO   |     |                |                |
| log_page      | int(10) unsigned    | YES  | MUL | NULL           |                |
| log_comment   | varbinary(767)      | NO   |     |                |                |
| log_params    | blob                | NO   |     | NULL           |                |
| log_deleted   | tinyint(3) unsigned | NO   |     | 0              |                |
+---------------+---------------------+------+-----+----------------+----------------+
MediaWiki バージョン:
1.23 – 1.24

DESCRIBE logging;

+---------------+---------------------+------+-----+----------------+----------------+
| Field         | Type                | Null | Key | Default        | Extra          |
+---------------+---------------------+------+-----+----------------+----------------+
| log_id        | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
| log_type      | varbinary(32)       | NO   | MUL |                |                |
| log_action    | varbinary(32)       | NO   |     |                |                |
| log_timestamp | binary(14)          | NO   | MUL | 19700101000000 |                |
| log_user      | int(10) unsigned    | NO   | MUL | 0              |                |
| log_user_text | varbinary(255)      | NO   | MUL |                |                |
| log_namespace | int(11)             | NO   | MUL | 0              |                |
| log_title     | varbinary(255)      | NO   |     |                |                |
| log_page      | int(10) unsigned    | YES  | MUL | NULL           |                |
| log_comment   | varbinary(255)      | NO   |     |                |                |
| log_params    | blob                | NO   |     | NULL           |                |
| log_deleted   | tinyint(3) unsigned | NO   |     | 0              |                |
+---------------+---------------------+------+-----+----------------+----------------+
MediaWiki バージョン:
1.16 – 1.22

DESCRIBE logging;

+---------------+---------------------+------+-----+----------------+----------------+
| Field         | Type                | Null | Key | Default        | Extra          |
+---------------+---------------------+------+-----+----------------+----------------+
| log_id        | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
| log_type      | varbinary(32)       | NO   | MUL |                |                |
| log_action    | varbinary(32)       | NO   |     |                |                |
| log_timestamp | binary(14)          | NO   | MUL | 19700101000000 |                |
| log_user      | int(10) unsigned    | NO   | MUL | 0              |                |
| log_user_text | varbinary(255)      | NO   |     |                |                |
| log_namespace | int(11)             | NO   | MUL | 0              |                |
| log_title     | varbinary(255)      | NO   |     |                |                |
| log_page      | int(10) unsigned    | YES  | MUL | NULL           |                |
| log_comment   | varbinary(255)      | NO   |     |                |                |
| log_params    | blob                | NO   |     | NULL           |                |
| log_deleted   | tinyint(3) unsigned | NO   |     | 0              |                |
+---------------+---------------------+------+-----+----------------+----------------+
MediaWiki バージョン:
1.13 – 1.15

DESCRIBE logging;

+---------------+---------------------+------+-----+----------------+----------------+
| Field         | Type                | Null | Key | Default        | Extra          |
+---------------+---------------------+------+-----+----------------+----------------+
| log_id        | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
| log_type      | varbinary(10)       | NO   | MUL |                |                |
| log_action    | varbinary(10)       | NO   |     |                |                |
| log_timestamp | binary(14)          | NO   | MUL | 19700101000000 |                |
| log_user      | int(10) unsigned    | NO   | MUL | 0              |                |
| log_namespace | int(11)             | NO   | MUL | 0              |                |
| log_title     | varbinary(255)      | NO   |     |                |                |
| log_comment   | varbinary(255)      | NO   |     |                |                |
| log_params    | blob                | NO   |     | NULL           |                |
| log_deleted   | tinyint(3) unsigned | NO   |     | 0              |                |
+---------------+---------------------+------+-----+----------------+----------------+
MediaWiki バージョン:
1.10 – 1.12

DESCRIBE logging;

+---------------+---------------------+------+-----+----------------+----------------+
| Field         | Type                | Null | Key | Default        | Extra          |
+---------------+---------------------+------+-----+----------------+----------------+
| log_id        | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
| log_type      | varbinary(10)       | NO   | MUL |                |                |
| log_action    | varbinary(10)       | NO   |     |                |                |
| log_timestamp | binary(14)          | NO   | MUL | 19700101000000 |                |
| log_user      | int(10) unsigned    | NO   | MUL | 0              |                |
| log_namespace | int(11)             | NO   | MUL | 0              |                |
| log_title     | varbinary(255)      | NO   |     |                |                |
| log_comment   | varbinary(255)      | NO   |     |                |                |
| log_params    | blob                | NO   |     | NULL           |                |
| log_deleted   | tinyint(3) unsigned | NO   |     | 0              |                |
+---------------+---------------------+------+-----+----------------+----------------+
MediaWiki バージョン:
1.6 – 1.9

DESCRIBE logging;

+---------------+---------------------+------+-----+----------------+----------------+
| 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 unsigned        | NO   | MUL | 0              |                |
| log_namespace | int                 | NO   | MUL | 0              |                |
| log_title     | varchar(255) binary | NO   |     | NULL           |                |
| log_comment   | varchar(255)        | NO   |     | NULL           |                |
| log_params    | blob                | NO   |     | NULL           |                |
+---------------+---------------------+------+-----+----------------+----------------+
MediaWiki バージョン:
1.5

DESCRIBE logging;

+---------------+---------------------+------+-----+----------------+----------------+
| Field         | Type                | Null | Key | Default        | Extra          |
+---------------+---------------------+------+-----+----------------+----------------+
| log_type      | char(10)            | NO   | MUL | NULL           |                |
| log_action    | char(10)            | NO   |     | NULL           |                |
| log_timestamp | char(14)            | NO   |     | 19700101000000 |                |
| log_user      | int unsigned        | NO   | MUL | 0              |                |
| log_namespace | int(11)             | NO   | MUL | 0              |                |
| log_title     | varchar(255) binary | NO   |     | NULL           |                |
| log_comment   | varchar(255)        | NO   |     | NULL           |                |
| log_params    | blob                | NO   |     | NULL           |                |
+---------------+---------------------+------+-----+----------------+----------------+
MediaWiki バージョン:
1.4

DESCRIBE logging;

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

インデックス

MediaWiki バージョン:
1.36

SHOW INDEX IN logging;

+---------+------------+---------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table   | Non_unique | Key_name            | Seq_in_index | Column_name   | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+---------+------------+---------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| logging |          0 | PRIMARY             |            1 | log_id        | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_type_time       |            1 | log_type      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_type_time       |            2 | log_timestamp | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_actor_time      |            1 | log_actor     | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_actor_time      |            2 | log_timestamp | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_page_time       |            1 | log_namespace | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_page_time       |            2 | log_title     | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_page_time       |            3 | log_timestamp | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_times           |            1 | log_timestamp | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_actor_type_time |            1 | log_actor     | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_actor_type_time |            2 | log_type      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_actor_type_time |            3 | log_timestamp | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_page_id_time    |            1 | log_page      | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               |
| logging |          1 | log_page_id_time    |            2 | log_timestamp | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_type_action     |            1 | log_type      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_type_action     |            2 | log_action    | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| logging |          1 | log_type_action     |            3 | log_timestamp | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+---------+------------+---------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+

関連項目