API:Logevents
From MediaWiki.org
| This page is part of the MediaWiki action API documentation. |
MediaWiki action API
- Introduction and quick start
- FAQ
- Tutorial
- 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.">
<move new_ns="1" new_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.">
<move new_ns="0" new_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">
<move new_ns="10" new_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. |
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 bug 17781
Child elements[edit]
Here are some examples of child elements that reveal log parameters:
- Block
<block flags="nocreate" duration="3 days" expiry="2014-09-18T20:35:54Z" />
- Move
<move new_ns="0" new_title="Foo" suppressredirect="" />
- Patrol
<patrol cur="12" prev="0" auto="1" />
- Rights
<rights new="sysop" old="" />
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 |
|---|