API:Logevents
| This page is part of the MediaWiki action API documentation. |
MediaWiki action API
- Introduction and quick start
- FAQ
- Formats
- Error reporting
- Restricting usage
- Cross-site requests
- Authentication
- Queries
- Searching (by title, content, coordinates...)
- Parsing wikitext and expanding templates
- Purging pages' caches
- Parameter information
- Changing wiki content
- Create and edit pages
- Move pages
- Merge pages
- Rollback
- Delete pages
- Restore deleted revisions
- (Un)protect pages
- (Un)block users
- (Un)watch pages
- Mark revisions of watched pages as visited
- Send email
- Patrol changes
- Import pages
- Change user group membership
- Upload files
- User options
- Tokens
- Page language
- More...
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
- Asserting
| Logevents | ||
|---|---|---|
This module cannot be used as a Generator. |
||
| Prefix | le | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
Get a list of all logged events, à la Special:Log. This module cannot be used as a generator.
Parameters[edit]
leprop: Which properties to get. (Default:ids|title|type|user|timestamp|comment|details)ids: Page ID of the page in question and log IDtitle: Title of the page in questiontype: Type of log entryuser: User responsible for the log entryuserid: The user ID who was responsible for the log event. When specified for account creation events, the userid of the creating user is returned. When absent, the userid returned is that of the created account (see bugzilla:71020).timestamp: Time and date the log entry was createdcomment: Log commentparsedcomment: The parsed comment of the eventdetails: Extra information (not present for all log types)tags: List tags for the event
letype: Only list log entries of this type. Note that extensions may add other log types.blockdeleteimportmergemovenewuserspatrolprotectstablerightsupload
leaction: Filter log actions to only this type. Overridesletypeeven if the action isn't related to letype. 1.17+block/blockblock/reblockblock/unblockdelete/deletedelete/eventdelete/restoredelete/revisionimport/interwikiimport/uploadmerge/mergemove/move_redirmove/movenewusers/autocreatenewusers/create2newusers/createnewusers/newuserspatrol/patrolprotect/modifyprotect/move_protprotect/protectprotect/unprotectrights/autopromoterights/erevokerights/rightsupload/overwriteupload/revertupload/upload
leuser: Only list log entries made by this userletitle: Only list log entries related to this titlelestart: The timestamp to start listing fromleend: The timestamp to end listing atledir: Direction to list in. (Default:older)older: List newest log entries first. Note:lestarthas to be later thanleend.newer: List oldest log entries first. Note:lestarthas to be earlier thanleend.
lelimit: Maximum number of log entries to list No more than 500 (5000 for bots) allowed. (Default: 10)leprefix: Filter entries that start with this prefix. Disabled in Miser Modeletag: Only list event entries tagged with this tag
Example[edit]
List the 3 most recent page moves
| Result |
|---|
<?xml version="1.0" encoding="utf-8"?>
<api>
<query-continue>
<logevents lestart="2008-03-25T21:26:37Z" />
</query-continue>
<query>
<logevents>
<item
logid="0"
pageid="16577509"
ns="1"
title="Talk:Parisii (France)"
type="move"
action="move"
user="QuartierLatin1968"
timestamp="2008-03-25T21:31:39Z"
comment="It is wrong to use such an anachronistic name.">
<params target_ns="1" target_title="Talk:Parisii (Gaul)" />
</item>
<item
logid="0"
pageid="16577508"
ns="0"
title="Parisii (France)"
type="move"
action="move"
user="QuartierLatin1968"
timestamp="2008-03-25T21:31:38Z"
comment="It is wrong to use such an anachronistic name.">
<params target_ns="0" target_title="Parisii (Gaul)" />
</item>
<item
logid="0"
pageid="16577421"
ns="10"
title="Template:User Brunei work group"
type="move"
action="move"
user="Black Falcon"
timestamp="2008-03-25T21:28:02Z"
comment="Has become a full WikiProject">
<params target_ns="10" target_title="Template:User WikiProject Brunei" />
</item>
</logevents>
</query>
</api>
|
Error Codes[edit]
| Code | Info |
|---|---|
| leparam_user | User name username not found |
| leparam_title | Bad title value 'title' This happens when you set letitle to an invalid title.
|
| The following documentation is the output of Special:ApiHelp/query+logevents, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
list=logevents (le)
- This module requires read rights.
- Source: MediaWiki
- License: GPL-2.0+
Get events from logs.
- leprop
Which properties to get:
- ids
- Adds the ID of the log event.
- title
- Adds the title of the page for the log event.
- type
- Adds the type of log event.
- user
- Adds the user responsible for the log event.
- userid
- Adds the user ID who was responsible for the log event.
- timestamp
- Adds the timestamp for the log event.
- comment
- Adds the comment of the log event.
- parsedcomment
- Adds the parsed comment of the log event.
- details
- Lists additional details about the log event.
- tags
- Lists tags for the log event.
- Values (separate with | or alternative): ids, title, type, user, userid, timestamp, comment, parsedcomment, details, tags
- Default: ids|title|type|user|timestamp|comment|details
- letype
Filter log entries to only this type.
- One of the following values: Can be empty, or spamblacklist, titleblacklist, gblblock, renameuser, globalauth, gblrights, gblrename, abusefilter, liquidthreads, massmessage, notifytranslators, thanks, usermerge, newsletter, block, protect, rights, delete, upload, move, import, patrol, merge, suppress, tag, managetags, contentmodel, timedmediahandler, translationreview, newusers, pagelang, pagetranslation
- leaction
Filter log actions to only this action. Overrides letype. In the list of possible values, values with the asterisk wildcard such as action/* can have different strings after the slash (/).
- One of the following values: gblblock/gblock, gblblock/gblock2, gblblock/gunblock, gblblock/modify, globalauth/delete, globalauth/lock, globalauth/unlock, globalauth/hide, globalauth/unhide, globalauth/lockandhid, globalauth/setstatus, suppress/setstatus, suppress/cadelete, gblrights/usergroups, gblrights/groupperms, gblrights/groupprms2, gblrights/groupprms3, suppress/hide-afl, suppress/unhide-afl, usermerge/mergeuser, usermerge/deleteuser, spamblacklist/*, titleblacklist/*, gblblock/whitelist, gblblock/dwhitelist, renameuser/renameuser, gblrights/grouprename, gblrename/rename, gblrename/promote, gblrename/merge, gblrights/newset, gblrights/setrename, gblrights/setnewtype, gblrights/setchange, gblrights/deleteset, abusefilter/hit, abusefilter/modify, liquidthreads/move, liquidthreads/split, liquidthreads/merge, liquidthreads/subjectedit, liquidthreads/resort, liquidthreads/signatureedit, massmessage/*, massmessage/send, massmessage/failure, massmessage/skipoptout, massmessage/skipnouser, massmessage/skipbadns, notifytranslators/sent, thanks/*, delete/flow-restore-post, suppress/flow-restore-post, delete/flow-restore-topic, suppress/flow-restore-topic, lock/flow-restore-topic, import/lqt-to-flow-topic, newsletter/*, block/block, block/reblock, block/unblock, contentmodel/change, contentmodel/new, delete/delete, delete/delete_redir, delete/event, delete/restore, delete/revision, import/interwiki, import/upload, managetags/activate, managetags/create, managetags/deactivate, managetags/delete, merge/merge, move/move, move/move_redir, patrol/patrol, patrol/autopatrol, protect/modify, protect/move_prot, protect/protect, protect/unprotect, rights/autopromote, rights/rights, suppress/block, suppress/delete, suppress/event, suppress/reblock, suppress/revision, tag/update, upload/overwrite, upload/revert, upload/upload, timedmediahandler/resettranscode, translationreview/message, translationreview/group, delete/flow-delete-post, delete/flow-delete-topic, suppress/flow-suppress-post, suppress/flow-suppress-topic, lock/flow-lock-topic, newusers/newusers, newusers/create, newusers/create2, newusers/byemail, newusers/autocreate, pagelang/pagelang, pagetranslation/mark, pagetranslation/unmark, pagetranslation/moveok, pagetranslation/movenok, pagetranslation/deletelok, pagetranslation/deletefok, pagetranslation/deletelnok, pagetranslation/deletefnok, pagetranslation/encourage, pagetranslation/discourage, pagetranslation/prioritylanguages, pagetranslation/associate, pagetranslation/dissociate
- lestart
The timestamp to start enumerating from.
- Type: timestamp (allowed formats)
- leend
The timestamp to end enumerating.
- Type: timestamp (allowed formats)
- ledir
In which direction to enumerate:
- newer
- List oldest first. Note: lestart has to be before leend.
- older
- List newest first (default). Note: lestart has to be later than leend.
- One of the following values: newer, older
- Default: older
- leuser
Filter entries to those made by the given user.
- Type: user name
- letitle
Filter entries to those related to a page.
- lenamespace
Filter entries to those in the given namespace.
- One of the following values: -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 90, 91, 92, 93, 100, 101, 102, 103, 104, 105, 106, 107, 486, 487, 828, 829, 1198, 1199, 2300, 2301, 2302, 2303, 2600, 5500, 5501
- leprefix
Disabled due to miser mode.
- letag
Only list event entries tagged with this tag.
- lelimit
How many total event entries to return.
- No more than 500 (5,000 for bots) allowed.
- Type: integer or max
- Default: 10
- lecontinue
When more results are available, use this to continue.
- List recent log events.
- api.php?action=query&list=logevents [open in sandbox]
Notes[edit]
For autoblock unblock entries, the page title is shown as "User:$blockid". This is indeed not a User page, just the way it is stored. As per task T19781
Results[edit]
It returns a list of items, each item being a log item.
Items can contain these properties, from the logging table:
-
logid: Content of thelog_idfield. -
ns: Content of thelog_namespacefield. -
title: Prefixed title from thelog_namespaceandlog_titlefields. -
pageid: Page id corresponding to the current page defined by the combination of thelog_namespaceandlog_titlefields. It represents the current page id, not the page id at the time the log was stored. -
logpage: Content of thelog_pagefield. It represents the page id at the time the log was stored. -
type: Content of thelog_typefield. -
action: Content of thelog_actionfield. -
userid: Content of thelog_userfield. -
user: Content of thelog_user_textfield. -
timestamp: Content of thelog_timestampfield formatted in ISO 8601 format. -
comment: Content of thelog_commentfield. -
actionhidden: Boolean indicating the title was hidden.nsandtitlewill be absent if the user has no sufficient rights to view deleted log entries. -
commenthidden: Boolean indicating the comment was hidden.commentwill be absent if the user has no sufficient rights to view deleted log entries. -
userhidden: Boolean indicating the user was hidden.useranduseridwill be absent if the user has no sufficient rights to view deleted log entries. -
suppressed: Boolean indicating details were supressed. Only users with thesuppressrevisioncan view them. -
params: Prettified content of thelog_paramsfield in array format:- Legacy parameters will contain numeric keys, where each key is a line.
- Other entries are formatted according to the LogFormatter class:
- In general, parameter names in "4::paramname" format are output as "paramname", stripping the index and type and formatting the value accordingly.
- If the parameter is a title, it's split in 2 parameters: paramname_ns (contains the namespace number) and paramname_title (contains the whole title, namespace included).
- Before MediaWiki 1.25:
- Parameters weren't in the
paramsproperty, but in a property with the same name as thetypevalue. - Some log types had different parameter names.
- Legacy parameters were in numeric keys directly inside the log entry and not inside the
paramsproperty.
- Parameters weren't in the
Here are some examples of child elements that reveal log parameters:
- Block
<block duration="3 days" expiry="2014-09-18T20:35:54Z"><flags><f>nocreate</f></flags></params>
- Move
<move target_ns="0" target_title="Foo" suppressredirect="" />
- Patrol
<params curid="12" previd="0" auto="1" />
- Rights
<params><newgroups><g>sysop</g></newgroups><oldgroups /></params>
See also[edit]
| Events: Blocking – Importing – Merging histories – Page deletion – Page moving – Page restoration – Patrolling – Protection – Renaming a user – RevisionDelete – Thanking – Uploading – User creation – User rights management – Merging users Settings: $wgLogTypes – $wgLogActions – $wgLogNames – $wgLogHeaders – $wgLogActionsHandlers – $wgLogRestrictions – $wgFilterLogTypes – $wgActionFilteredLogs |
| Language: | English • polski |
|---|