I found out how I can log all Flarum events while developing and debugging extensions. Here is how I did it:
<?php
use Illuminate\Contracts\Events\Dispatcher;
return [
function (Dispatcher $events) {
// Log all Flarum events
$events->listen('*', function ($event) {
if (!starts_with($event, "illuminate.log")) {
if (starts_with($event, "Flarum")) {
app('log')->debug("Event fired: " . $event);
}
}
});
}
];