Erweiterung:EventLogging
![]() Freigabestatus: stabil |
|
---|---|
Einbindung | Spezialseite , Datenbank , ContentHandler |
Beschreibung | Provides a framework for logging analytics events |
Autor(en) | Ori.livnehDiskussion |
Letzte Version | Laufende Aktualisierungen |
MediaWiki | 1.33+ |
PHP | 5.5+ |
Datenbankänderungen | Nein |
Lizenz | GNU General Public License 2.0 oder neuer |
Herunterladen | |
|
|
Übersetze die EventLogging-Erweiterung, wenn sie auf translatewiki.net verfügbar ist | |
Vagrant-Rolle | eventlogging |
Probleme | Offene Aufgaben · Einen Fehler melden |
The EventLogging extension makes it possible to collect structured data on how users interact with MediaWiki sites.
Funktionen
- EventLogging supports client-side logging from JavaScript and server-side logging from PHP.
- Logging behavior can be dynamically configured using Erweiterung: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
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.
Installation
- Die Erweiterung herunterladen und die Datei(en) in ein Verzeichnis namens
EventLogging
im Ordnerextensions/
ablegen. - Folgenden Code am Ende deiner
LocalSettings.php
hinzufügen:wfLoadExtension( 'EventLogging' ); $wgEventLoggingBaseUri = '/beacon/event'; $wgEventLoggingServiceUri = '/beacon/intake-analytics';
Erledigt – Zu Special:Version in dem Wiki (bei Einstellung auf deutsch nach Spezial:Version) navigieren, um die erfolgreiche Installierung der Erweiterung zu überprüfen.
Vagrant-Installation:
- Wird Vagrant benutzt, ist mit
vagrant roles enable eventlogging --provision
zu installieren
Configuring the schema location
By default, the extension will look for schemas on Meta-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 the Schema
namespace of the local wiki, set
$wgEventLoggingSchemaApiUri = $wgServer . '/w/api.php';
$wgEventLoggingDBname = $wgDBname;
(and ensure the user account that will create the schemas is autoconfirmed).
Logging events using EventLogging
- Extension:EventLogging/Guide - to developing and deploying EventLogging schemas, and more
- Extension:EventLogging/Programming - tips and suggestions for developers writing code to log events
Developing the EventLogging extension
Entwickler-Einrichtung
As a developer, you will want to set up and use EventLogging on your development wiki to simulate its use in production.
Mit Docker
Siehe MediaWiki-Docker/Configuration recipes/EventLogging
Mit mediawiki-vagrant
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
Für JavaScript-Entwicklung
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 npm test
to run ESLint for example.
The "How to run tests" section below points out how to see JavaScript test results.
When adding the parameter trackdebug=true
to the URL, the console in the browser's devtools will show the event logging being triggered.
Wie man Tests ausführt
Es gibt PHP-Tests, Python-Tests und JavaScript-Tests.
Um JavaScript-Tests auszuführen, besuche Special:JavaScriptTest/qunit auf deinem Entwicklungswiki. (Siehe Manual:JavaScript unit testing .)
Um PHP-Tests auszuführen, verwenden wir PHPUnit. Stelle sicher, dass es installiert ist, dann:
$ vagrant ssh
vagrant@mediawiki-vagrant:/vagrant/mediawiki/extensions/EventLogging/tests$ php /vagrant/mediawiki/tests/phpunit/phpunit.php EventLoggingExtensionFunctionsTest.php
![]() | Diese Erweiterung ist in den folgenden Paketen und/oder WikiFarmen beinhalten: |
- Stable extensions/de
- Special page extensions/de
- Database extensions/de
- ContentHandler extensions/de
- GPL licensed extensions/de
- Extensions in Wikimedia version control/de
- ApiMain::moduleManager extensions/de
- BeforePageDisplay extensions/de
- CanonicalNamespaces extensions/de
- CodeEditorGetPageLanguage extensions/de
- EditFilterMergedContent extensions/de
- GetPreferences extensions/de
- MovePageIsValidMove extensions/de
- All extensions/de
- Extensions included in Canasta/de
- Extensions included in Miraheze/de
- Analytics extensions/de
- Statistics extensions/de