Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Extension:EventLogging

From mediawiki.org
Translate this page
Languages:
MediaWiki extensions manual
EventLogging
Release status: stable
ImplementationSpecial page,Database,ContentHandler
DescriptionProvides a framework for logging analytics events
Author(s)Ori.livnehtalk
Latest versioncontinuous updates
MediaWiki1.33+
PHP5.5+
Database changesNo
LicenseGNU General Public License 2.0 or later
Download
  • $wgEventLoggingStreamNames
  • $wgEventLoggingSchemaApiUri
  • $wgEventLoggingServiceUri
  • $wgEventLoggingQueueLingerSeconds
  • $wgEventLoggingBaseUri
  • $wgEventLoggingSchemas
  • $wgEventLoggingDBname
Translate the EventLogging extension if it is available at translatewiki.net
Vagrant roleeventlogging
IssuesOpen tasks ·Report a bug

The EventLogging extension makes it possible to collect structured data on how users interact with MediaWiki sites.

Features

[edit]
  • EventLogging supports client-side logging from JavaScript and server-side logging from PHP.
  • Logging behavior can be dynamically configured usingExtension:EventStreamConfig.
  • The events are JSON objects defined by versioned JSONSchemas stored in a schema git repository.
  • The extension does not include any back-end code for transporting, parsing, or loading these events. A separate service,EventGate, implements this functionality and deals with inserting events into Kafka. Events are then persisted in downstream datastores (e.g. Hive) via various ingestion pipelines. The details of these components are specific to Wikimedia Foundation's configuration.

EventLogging at Wikimedia

[edit]

The Wikimedia Foundation uses the EventLogging extension as part of abroader system for collecting, aggregating, storing, and analyzing user data within the limits set out by ourprivacy policy anddata retention guidelines.

This page is about general use of the EventLogging extension.The Wikimedia Foundation uses EventLogging with WMF specific backend components andschema repositories.For Wikimedia specific and maintained documentation, seewikitech:Analytics/Systems/EventLogging andwikitech:Event Platform.

Installation

[edit]
  • Download and move the extractedEventLogging folder to yourextensions/ directory.
    Developers and code contributors should install the extensionfrom Git instead, using:
    cdextensions/gitclonehttps://gerrit.wikimedia.org/r/mediawiki/extensions/EventLogging
  • Add the following code at the bottom of yourLocalSettings.php file:
    wfLoadExtension('EventLogging');$wgEventLoggingBaseUri='/beacon/event';$wgEventLoggingServiceUri='/beacon/intake-analytics';$wgEventLoggingStreamNames=false;
  • YesDone – Navigate toSpecial:Version on your wiki to verify that the extension is successfully installed.


Vagrant installation:

  • If usingVagrant, install withvagrant roles enable eventlogging --provision

Configuring the schema location

[edit]

By default, the extension will look for schemas onMeta-Wiki.The relevant default settings are:

# (default) $wgEventLoggingSchemaApiUri = 'https://meta.wikimedia.org/w/api.php';# (default) $wgEventLoggingDBname = 'metawiki';

To use local schemas, or schemas from the central wiki of your own wikifarm, you need to override these. E.g. to use theSchema namespace of the local wiki, set

$wgEventLoggingSchemaApiUri=$wgServer.'/w/api.php';$wgEventLoggingDBname=$wgDBname;

(and ensure the user account that will create the schemas isautoconfirmed).

Logging events using EventLogging

[edit]

Developing the EventLogging extension

[edit]

Developer setup

[edit]

As a developer, you will want to set up and use EventLogging on your development wiki to simulate its use in production.

Using Docker

[edit]

SeeMediaWiki-Docker/Configuration recipes/EventLogging

Using mediawiki-vagrant

[edit]

If you develop using mediawiki-vagrant, everything you need is encapsulated in theeventlogging role.To enable it, run:

$vagrantrolesenableeventlogging$vagrantprovision

For JavaScript development

[edit]

If working on the JavaScript client, you'll need to install dependencies withnpm install from the folder you're developing in.Then you can usenpm test to run ESLint for example.The "How to run tests" section below points out how to see JavaScript test results.

When adding the parametertrackdebug=true to the URL, the console in the browser's devtools will show the event logging being triggered.

How to run tests

[edit]

There are PHP tests, Python tests, and JavaScript tests.

To run JavaScript tests, visit Special:JavaScriptTest/qunit on your development wiki.(SeeManual:JavaScript unit testing.)

To run PHP tests, we use PHPUnit.Make sure it is installed, then:

$vagrantsshvagrant@mediawiki-vagrant:/vagrant/mediawiki$composerphpunit:entrypoint--extensions/EventLogging/testsEventLoggingExtensionFunctionsTest.php
This extension is being used on one or moreWikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia'sCommonSettings.php andInitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki'sSpecial:Version page.
This extension is included in the following wiki farms/hosts and/or packages:This is not an authoritative list.Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here.Always check with your wiki farms/hosts or bundle to confirm.
Retrieved from "https://www.mediawiki.org/w/index.php?title=Extension:EventLogging&oldid=6176130"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp