Manual:Tabela de logging

This page is a translated version of the page Manual:Logging table and the translation is 36% complete.
Outdated translations are marked like this.
Manual:Conteúdos Leiaute do banco de dados do MediaWiki logging table
Versão MediaWiki:
1.4

Cada ação no MediaWiki é registrada na tabela de logging. É possível para o usuário ver essas ações em Special:Log, com exceção de alguns registros restritos (como Special:Log/suppress).

O conteúdo desta tabela é o que você verá na página Special:Log. Por exemplo:

  • 14:18, 25 June 2008 Jacksprat (Talk | contribs| block) uploaded "Image:Climb.jpg" (Adicionada esta imagem para a página relacionada)

Campos

log_id

Versão MediaWiki:
1.10

Chave principal da tabela. rc_logid é uma chave externa que se liga nessa coluna

log_type

O tipo da ação, ou o “tipo de registro”.

Você pode filtrar por alguns valores deste tipo em Special:Log.

Comparável a $type.

Valores de exemplo de alguns wikis da Wikimedia são os seguintes (incluindo logs agora obsoletos e várias extensões):

  • 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

A ação realizada. Pode haver várias ações possíveis para um determinado tipo: por exemplo, uma entrada com o tipo delete pode ter a ação delete ou restore, etc. Comparável a $action. Veja também API:Logevents#Parameters . Ver Manual:Log actions .

log_timestamp

O tempo que a ação foi executada, no formato de carimbo de data/hora MediaWiki usa em todos os lugares no banco de dados: yyyymmddhhmmss ("14:18, 25 de junho de 2008" no exemplo). Comparável a $rc e $rev. Se o evento de log é um upload de arquivo, este campo não é necessariamente o mesmo que o image.img_timestamp gerado por $recordUpload.

log_user

Versão MediaWiki:
1.33

O id do usuário que realizou a ação. Esta é uma referência na tabela user (o ID do usuário de"Jacksprat" no exemplo). Comparável a $rc e $rev.

Deprecated in favor of log_actor.

log_user_text

Versão MediaWiki:
1.16

user_name do usuário que realizou a ação, destinado principalmente a usuários anônimos, preenchido pormaintenance/populateLogUsertext.php. Comparável a $rc e $rev.

Deprecated in favor of log_actor.

log_actor

Versão 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

O namespace da página afetada. Juntamente com log_title, esta é uma referência na tabela page ("Image:Climb.jpg" no exemplo). da página afetada. $rc. Comparable to rc_namespace .

A tabela de registro pode conter linhas com log_namespace < 0:
  • Special:Renameuser com log_type e log_action sendo "" ou "renameuser"
  • Special:Userlogin with log_type being "newusers" and log_action e.g. being "create"

log_title

The title of the affected page. Together with log_namespace, this is a reference into the page table. Comparable to rc_title

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

For user blocks, this is the blocked user's username. For thanks action, this is the thanked user's username.

log_page

Versão MediaWiki:
1.16

The page_id that this log action is about. Comparable to rc_cur_id and 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

Versão MediaWiki:
1.32

The comment given for the action; that is the upload comment for uploads, the deletion comment for deletions, etc. Comparable to rc_comment and rev_comment .

(obsoleto); log_comment_id and the comment table should be used instead!

log_comment_id

Versão MediaWiki:
1.30

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

log_params

Versão 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 .

Versão 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%'
Versão 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 |
+----------------------------------+------------+

enquanto costumava parecer:

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

Versão MediaWiki:
1.10

Used with the RevisionDelete system to delete log entries. Comparable to rc_deleted and 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 Usuário excluído
  • 8 Se a informação excluída for restrita. If this field is not set, then only deletedhistory right is needed, otherwise you need suppressrevision right. (Nas wikis Wikimedia, isso corresponde a se os administradores podem ver a entrada, ou se apenas os superadores podem)

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.

Sumário do esquema

Versão 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              |                |
+----------------+---------------------+------+-----+----------------+----------------+
Versão 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              |                |
+----------------+---------------------+------+-----+----------------+----------------+
Versões do 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              |                |
+----------------+---------------------+------+-----+----------------+----------------+
Versão 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              |                |
+----------------+---------------------+------+-----+----------------+----------------+
Versões do 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              |                |
+---------------+---------------------+------+-----+----------------+----------------+
Versões do 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              |                |
+---------------+---------------------+------+-----+----------------+----------------+
Versões do 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              |                |
+---------------+---------------------+------+-----+----------------+----------------+
Versões do 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              |                |
+---------------+---------------------+------+-----+----------------+----------------+
Versões do 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              |                |
+---------------+---------------------+------+-----+----------------+----------------+
Versões do 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           |                |
+---------------+---------------------+------+-----+----------------+----------------+
Versão 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           |                |
+---------------+---------------------+------+-----+----------------+----------------+
Versão 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           |                |
+---------------+---------------------+------+-----+----------------+----------------+

Indexes

Versão 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      |         |               |
+---------+------------+---------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+

Ver também