Manual:Logging table/pt-br

Cada ação no MediaWiki é registrada na tabela de registros. É 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:



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

log_type
O tipo da ação, ou o “tipo de registro”. É possível filtrar por tipo em Special:Log. Os valores típicos são: block, delete, import, makebot, move, newusers, protect, renameuser, rights, upload ("carregado" no exemplo) Comparável a. Valores em itwiki, a partir de novembro de 2014, são (incluindo registros obsoletos e várias extensões):

MariaDB [itwiki_p]> SELECT DISTINCT log_type FROM logging; +---+ +---+ +---+ 16 rows in set (0.01 sec)
 * log_type     |
 * abusefilter  |
 * block        |
 * delete       |
 * gblblock     |
 * import       |
 * massmessage  |
 * merge        |
 * move         |
 * newusers     |
 * patrol       |
 * protect      |
 * renameuser   |
 * rights       |
 * spamblacklist |
 * thanks       |
 * upload       |

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. Veja também. Ver.

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 e. If the log event is a file upload, this field is not necessarily the same as the generated by.

log_user
The of the user who performed the action. This is a reference into the table (the user id of "Jacksprat" in example). Comparable to and.

log_user_text
of the user who performed the action, intended primarily for anonymous users, fillable by maintenance/populateLogUsertext.php. Comparable to and.

log_namespace
The namespace of the affected page. Together with log_title, this is a reference into the table ("Image:Climb.jpg" in example). Comparable to.


 * Special:Renameuser with log_type and log_action being either "" or "renameuser"
 * Special:Userlogin with log_type being "newusers" and log_action e.g. being "create"

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

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

log_page
The that this log action is about. Comparable to and. In the case of a page move, this is set to the page_id of the moved page (since ). Formerly, it was the page_id of the redirect, or 0 if the page was moved without creating a redirect.

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


 * log_comment_id and the comment table should be used instead!

log_comment_id
This is a foreign key to in the  table.

log_params
Additional parameters, usually empty. Mirrored in. 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. For other examples, see.

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%'

Since, 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 to facilitate indexed queries. Log parameters are typically set using functions such as and.

log_deleted
Used with the system to delete log entries. This field is comparable to and. 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
+---+-+--+-+++ +---+-+--+-+++ +---+-+--+-+++
 * Field        | Type                | Null | Key | Default        | Extra          |
 * log_id       | int(10) unsigned    | NO   | PRI | NULL           | AUTO_INCREMENT |
 * log_type     | varbinary(32)       | NO   | MUL | NULL           |                |
 * log_action   | varbinary(32)       | NO   |     | NULL           |                |
 * log_timestamp | binary(14)         | NO   | MUL | 19700101000000 |                |
 * log_user     | int unsigned        | NO   | MUL | 0              |                |
 * log_user_text | varchar(255) binary | NO  | MUL | NULL           |                |
 * log_namespace | int                | NO   | MUL | 0              |                |
 * log_title    | varchar(255) binary | NO   | MUL | NULL           |                |
 * log_page     | int unsigned        | YES  |     | NULL           |                |
 * log_comment  | varbinary(767)      | NO   |     | NULL           |                |
 * log_params   | blob                | NO   |     | NULL           |                |
 * log_deleted  | tinyint(3) unsigned | NO   |     | 0              |                |

+---+-+--+-+++ +---+-+--+-+++ +---+-+--+-+++
 * Field        | Type                | Null | Key | Default        | Extra          |
 * log_id       | int(10) unsigned    | NO   | PRI | NULL           | AUTO_INCREMENT |
 * log_type     | varbinary(32)       | NO   | MUL | NULL           |                |
 * log_action   | varbinary(32)       | NO   |     | NULL           |                |
 * log_timestamp | binary(14)         | NO   | MUL | 19700101000000 |                |
 * log_user     | int unsigned        | NO   | MUL | 0              |                |
 * log_user_text | varchar(255) binary | NO  | MUL | NULL           |                |
 * log_namespace | int                | NO   | MUL | 0              |                |
 * log_title    | varchar(255) binary | NO   | MUL | NULL           |                |
 * log_page     | int unsigned        | YES  |     | NULL           |                |
 * log_comment  | varchar(255)        | NO   |     | NULL           |                |
 * log_params   | blob                | NO   |     | NULL           |                |
 * log_deleted  | tinyint(3) unsigned | NO   |     | 0              |                |

+---+-+--+-+++ +---+-+--+-+++ +---+-+--+-+++
 * Field        | Type                | Null | Key | Default        | Extra          |
 * log_id       | int(10) unsigned    | NO   | PRI | NULL           | AUTO_INCREMENT |
 * log_type     | varbinary(32)       | NO   | MUL | NULL           |                |
 * log_action   | varbinary(32)       | NO   |     | NULL           |                |
 * log_timestamp | binary(14)         | NO   | MUL | 19700101000000 |                |
 * log_user     | int unsigned        | NO   | MUL | 0              |                |
 * log_user_text | varchar(255) binary | NO  |     | NULL           |                |
 * log_namespace | int                | NO   | MUL | 0              |                |
 * log_title    | varchar(255) binary | NO   | MUL | NULL           |                |
 * log_page     | int unsigned        | YES  |     | NULL           |                |
 * log_comment  | varchar(255)        | NO   |     | NULL           |                |
 * log_params   | blob                | NO   |     | NULL           |                |
 * log_deleted  | tinyint(3) unsigned | NO   |     | 0              |                |

+---+-+--+-+++ +---+-+--+-+++ +---+-+--+-+++
 * 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 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           |                |
 * log_id       | int(10) unsigned    | NO   | PRI | NULL           | AUTO_INCREMENT |
 * log_deleted  | tinyint(3) unsigned | NO   |     | 0              |                |

+---+-+--+-+++ +---+-+--+-+++ +---+-+--+-+++
 * 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           |                |

+---+-+--+-+++ +---+-+--+-+++ +---+-+--+-+++
 * 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           |                |

+---+-+--+-+++ +---+-+--+-+++ +---+-+--+-+++
 * 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           |                |

Ver também

 * m:Help:Special page#Logs