API:Logevents
From MediaWiki.org
| This page is part of the MediaWiki API documentation. |
Quick overview:
- Quick start guide
- FAQ
- Tutorial
- Formats
- Error reporting
- Restricting usage
- Cross-site requests
- Authentication
- Queries
- Search suggestions
- Parsing wikitext and expanding templates
- Purging pages' caches
- Parameter information
- Changing wiki content
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
- Asserting
| MediaWiki version: | 1.9 |
Get a list of all logged events, à la Special:Log. This module cannot be used as a generator.
Parameters[edit | edit source]
leprop: Which properties to getids: Page ID of the page in question and log ID (default)title: Title of the page in question (default)type: Type of log entry (default)user: User responsible for the log entry (default)userid: 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 created (default)comment: Log comment (default)parsedcomment: The parsed comment of the eventdetails: Extra information (not present for all log types) (default)tags: List tags for the event
letype: Only list log entries of this typeblockprotectrightsdeleteuploadmoveimportpatrolmergenewusers- Extensions may add other log types
leaction: Filter log actions to only this type. Overridesletypeeven if the action isn't related to letype.block/blockblock/unblockblock/reblockprotect/protectprotect/modifyprotect/unprotectprotect/move_protrights/rightsrights/autopromoteupload/uploadupload/overwriteupload/revertimport/uploadimport/interwikimerge/mergesuppress/blocksuppress/reblockreview/approvereview/approve2review/approve-ireview/approve2-ireview/approve-areview/approve2-areview/approve-iareview/approve2-iareview/unapprovereview/unapprove2rights/erevokegblblock/gblockgblblock/gblock2gblblock/gunblockgblblock/whitelistgblblock/dwhitelistgblblock/modifyglobalauth/deleteglobalauth/lockglobalauth/unlockglobalauth/hideglobalauth/unhideglobalauth/lockandhidglobalauth/setstatussuppress/setstatusgblrights/usergroupsgblrights/grouppermsgblrights/groupprms2gblrights/groupprms3suppress/hide-aflsuppress/unhide-aflmoodbar/hidemoodbar/restoremoodbar/feedbackmove/movemove/move_redirdelete/deletedelete/restoredelete/revisiondelete/eventsuppress/revisionsuppress/eventsuppress/deletepatrol/patrolstable/configstable/modifystable/resetrenameuser/renameusergblrights/newsetgblrights/setrenamegblrights/setnewtypegblrights/setchangegblrights/deletesetabusefilter/modifyabusefilter/hitsuppress/oversightsuppress/unoversightsuppress/declinesuppress/requestsuppress/unrequestarticlefeedbackv5/hiddenarticlefeedbackv5/unhiddenarticlefeedbackv5/flagarticlefeedbackv5/unflagarticlefeedbackv5/autoflagarticlefeedbackv5/autohidearticlefeedbackv5/featurearticlefeedbackv5/unfeaturearticlefeedbackv5/resolvearticlefeedbackv5/unresolvearticlefeedbackv5/helpfularticlefeedbackv5/unhelpfularticlefeedbackv5/undo-helpfularticlefeedbackv5/undo-unhelpfularticlefeedbackv5/clear-flagspagetriage-curation/reviewedpagetriage-curation/unreviewedpagetriage-curation/tagpagetriage-curation/deletepagetriage-deletion/deletenewusers/newusersnewusers/createnewusers/create2newusers/autocreate
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 inolder: List newest log entries first (default). Note:lestarthas to be later thanleend.newer: List oldest log entries first. Note:lestarthas to be beforeleend.
lelimit: Maximum number of log entries to list (10 by default)leprefix: Filter entries that start with this prefix. Disabled in Miser Modeletag: Only list event entries tagged with this tag
Example[edit | edit source]
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 | edit source]
- code: leparam_user
- info: User name username not found
- code: leparam_title
- info: Bad title value 'title'
- This happens when you set
letitleto an invalid title
- This happens when you set
- info: Bad title value 'title'
Notes[edit | edit source]
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 | edit source]
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 | edit source]
| Events: Blocking – Importing – Merging histories – Page deletion – Page moving – Page restoration – Patrolling – Protection – Renaming a user – Revision deletion – Thanking – Uploading – User creation – User rights management Miscellaneous: API – logging table – Null revision |