PHP logging

EventLogging::logEvent( 'Edit', 18476212, $event );

extension.json setup for JavaScript logging

{
	"attributes": {
		"EventLogging": {
			"Schemas": {
				"Edit": 18476212
			}
		}
	}
}

JavaScript logging

mw.track( 'event.Edit', { /* ... */ } );

Schema:Edit

From Meta, a Wikimedia project coordination wiki
Revision 18476212
Jump to navigation Jump to search
description"Logs generic events related to editing activity. All events are logged client-side, except that init and saveSuccess events for the wikitext editor are logged server-side."
properties
version
type"integer"
requiredtrue
description"Version number. This field can be used to track changes in instrumentation that affect the nature of the data collected."
isOversample
description"Whether this request is an oversample, or a standard sample."
type"boolean"
action
type"string"
requiredtrue
enum
"init"
"ready"
"loaded"
"saveIntent"
"saveAttempt"
"saveSuccess"
"saveFailure"
"abort"
description"The actions involved in an attempt to edit a page: init: Initiation of the editor ready: Editor is ready for user input – 'cursor blinking' loaded: Editor has fully loaded saveIntent: Editor pre-save button (if available) has been activated, showing user intent to save (regardless of whether they continue) saveAttempt: Editor save button has been activated, showing user attempt to save (regardless of success) saveSuccess: Editor has successfully saved and user has been shown a post-edit status on the client-side saveFailure: Editor has not successfully saved and user has been shown a save failure reason on the client-side abort: Editor has been aborted by user action."
action.init.type
type"string"
enum
"page"
"section"
description"Type information about action=init page: Editing has been initiated for the whole page section: Editing has been initiated for a section of the page."
action.init.mechanism
type"string"
enum
"click"
"new"
"url"
description"Mechanism information about action=init click: Editing has been initiated from an edit link new: Editing has been initiated by clicking on redlink if type=page or new section link if type=section url: Editing has been initiated by direct navigation."
action.init.timing
type"integer"
description"Timing information about action=init – time in milliseconds since the page was loaded."
action.ready.timing
type"integer"
description"Timing information about action=ready – time in milliseconds since the editor was initialised."
action.loaded.timing
type"integer"
description"Timing information about action=loaded – time in milliseconds since the editor was initialised."
action.saveIntent.timing
type"integer"
description"Timing information about action=saveIntent – time in milliseconds since the editor was ready."
action.saveAttempt.timing
type"integer"
description"Timing information about action=saveAttempt – time in milliseconds since the user triggered saveIntent."
action.saveSuccess.timing
type"integer"
description"Timing information about action=saveSuccess – time in milliseconds spent by the system processing save (sum of two parts: saveIntent to saveReady, and saveAttempt to saveSuccess)."
action.saveFailure.type
type"string"
enum
"userBadToken"
"userNewUser"
"extensionAbuseFilter"
"extensionCaptcha"
"extensionSpamBlacklist"
"extensionTitleBlacklist"
"responseEmpty"
"responseUnknown"
"editPageDeleted"
"editConflict"
description"Type information about action=saveFailure userBadToken: Save attempt failed because the user's token was bad userNewUser: Save attempt failed because the user's session has changed user extensionAbuseFilter: Save attempt failed because of the AbuseFilter extension extensionCaptcha: Save attempt failed because of the CAPTCHA extensions extensionSpamBlacklist: Save attempt failed because of the SpamBlacklist extension responseEmpty: Save attempt failed but the response was empty responseUnknown: Save attempt failed but the response was not recognised editPageDeleted: Save attempt failed because the page was deleted editConflict: Save attempt failed because of an edit conflict"
action.saveFailure.message
type"string"
description"The message key given for the first error when saving."
action.saveFailure.timing
type"integer"
description"Timing information about action=saveFailure – time in milliseconds spent by the system processing save (sum of two parts: saveIntent to saveReady, and saveAttempt to saveFail)."
action.abort.type
type"string"
enum
"preinit"
"nochange"
"switchwith"
"switchwithout"
"switchnochange"
"abandon"
"abandonMidsave"
description"Type information about action=abort: preinit: Editor has be initialised but is not yet ready nochange: User is exiting the editor, and content block is unchanged / transaction stack is empty switchwith: User is switching from one editor to another, retaining changes switchwithout: User is switching from one editor to another, discarding changes switchnochange: User is switching from one editor to another, and the content block is unchanged / transaction stack is empty abandon: User is exiting the editor, discarding changes abandonMidsave: User is exiting the editor, discarding changes, after a saveAttempt has been initiated but before saveSuccess/saveFailure."
action.abort.mechanism
type"string"
enum
"cancel"
"navigate"
"navigate-back"
"navigate-read"
description"Mechanism information about action=abort: cancel: Editing was aborted by user clicking a cancel control navigate: Editing was aborted by user navigating to another page navigate-back: Editing was aborted by user navigating to the previous page by means of the 'back' button/control in their browser navigate-read: Editing was aborted by user navigating to the read page by means of the 'read' tab/control in their browser."
action.abort.timing
type"integer"
description"Timing information about action=abort – time in milliseconds based on action.abort.type: preinit: Time since the editor was initialised nochange: Time since the editor was ready switchwith: Time since the editor was ready switchwithout: Time since the editor was ready abandon: Time since the editor was ready abandonMidsave: Time since the user initiated a saveAttempt."
editor
type"string"
enum
"visualeditor"
"wikitext-2017"
"wikitext"
"other"
requiredtrue
description"The editor interface through which the user is attempting to edit the page."
mediawiki.version
type"string"
requiredtrue
description"MediaWiki version string."
platform
type"string"
enum
"desktop"
"tablet"
"phone"
"other"
requiredtrue
description"The editing device through which the user is attempting to edit the page."
integration
type"string"
enum
"page"
"flow"
"lqt"
"app"
requiredtrue
description"The editor integration through which the user is attempting to edit the page."
page.id
type"integer"
description"ID of the page the user is attempting to edit."
page.title
type"string"
description"Full title of the page the user is attempting to edit, including namespace (wgPageName format). This is needed to log edit activity on redlinks, as pageId and revId are not available."
page.ns
type"integer"
description"Namespace ID of the page the user is attempting to edit."
page.revid
type"integer"
description"Current revision of the page the user is currently attempting to edit, if available. For action=saveAttempt, it is the old revId for the page, since it is not yet known whether the edit will succeed. Is updated to the latest revision for action=saveSuccess events."
editingSessionId
type"string"
requiredtrue
description"A string of 32 alphanumeric characters, unique to the current page view session; used for grouping events."
user.id
type"integer"
requiredtrue
description"The user id (0 if logged out)."
user.editCount
type"integer"
requiredtrue
description"The total number of edits of the user."
user.class
type"string"
enum
"IP"
"bot"
description"A flag for a kind of user about whom we don't care or for whom we can't measure edit counts."