MediaWiki-Docker/Configuration recipes/EventLogging

Event Platform
Setting up and configuring your MediaWiki-Docker instance as below will leave you with a Wikimedia production Event Platform-like environment. You will be able to log events to a containerized EventGate instance (herein "EventGate") from both MediaWiki and JavaScript. EventGate will validate events against schemas fetched from https://schema.wikimedia.org.

Extensions
You need to install these extensions:


 * EventBus
 * EventStreamConfig
 * EventLogging
 * WikimediaEvents
 * WikimediaEvents is not strictly required as it contains Wikimedia-specific instruments.

i.e.

Running
You can test the above by running this in your browser's JavaScript console:

Event Platform with Local Schema Repositories
Iterating on the above, setting up and configuring your MediaWiki-Docker instance as below will reconfigure EventGate to validate events against schemas from clones of the schema repositories.

Repositories
You need to clone these repositories into the  directory:


 * schemas/event/primary
 * schemas/event/secondary

e.g.

Legacy EventLogging
In the legacy EventLogging pipeline, schemas were defined and documented on metawiki. Event though the legacy EventLogging pipeline is being migrated away from, you might still be called on to modify an instrument that uses one such schema.

Following on from the section above, setting up and configuring your MediaWiki-Docker instance as below will allow you to log events to a containerized legacy EventLogging event intake service.

Unit testing
If you need to run PHPUnit tests in docker, any test which incidentally causes event logging to occur will cause PHPUnit to error immediately with  The easiest way to avoid this is to not configure event logging when the unit tests are running. This can be done in  like so: If you actually need to test the sending of events... good luck, please update this recipe if you work it out.