To log custom activities happening in your custom plugin, you can define Activity classes (extending Piwik\Plugins\ActivityLog\Activity\Activity).

You need to place these classes in a directory named Activity within any plugin. The Activity Log will then include all such activities recorded by your plugin.

Previous FAQ: How do I enable Gravatar images in the Activity Log?