Extension:EventLogging

(Redirected from EventLogging)
Other languages:
English • ‎русский
MediaWiki extensions manual
OOjs UI icon advanced.svg
EventLogging
Release status: stable
Implementation Special page , Database , ContentHandler
Description Provides a framework for logging analytics events
Author(s) Ori.livnehtalk
Latest version continuous updates
MediaWiki 1.33+
PHP 5.5+
Database changes No
License GNU 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
Check usage and version matrix.
Vagrant role eventlogging
Issues Open tasks · Report a bug

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

FeaturesEdit

  • EventLogging supports client-side logging from JavaScript and server-side logging from PHP.
  • Logging behavior can be dynamically configured using Extension: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 WikimediaEdit

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

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

Logging events using EventLoggingEdit

Developing the EventLogging extensionEdit

Developer setupEdit

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

Using mediawiki-vagrantEdit

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

$ vagrant roles enable eventlogging
$ vagrant provision

For JavaScript developmentEdit

If working on the javascript client, you'll need to install dependencies with npm install from the folder you're developing in. Then you can use ./node_modules/grunt/bin/grunt eslint to lint for example. The "How to run tests" section below points out how to see JavaScript test results.

How to run testsEdit

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

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

To run PHP tests, we use PHPUnit. Make sure it is installed, see: Manual:PHP unit testing/Installing PHPUnit). Then

$ vagrant ssh
vagrant@mediawiki-vagrant:/vagrant/mediawiki/extensions/EventLogging/tests$ php /vagrant/mediawiki/tests/phpunit/phpunit.php EventLoggingExtensionFunctionsTest.php