As per Enterprise Messaging Platform in the Summer '17 release notes and First Impressions with Platform Events and the Salesforce Enterprise Messaging Platform I created a simple Platform Event with the API name TestEvent__e
and a corresponding trigger.
trigger TestEventTrigger on TestEvent__e (after insert) {
System.debug('Event Log');
for (TestEvent__e event : Trigger.New) {
System.debug('Event: ' + event);
}
}
Then I ran the following anonymous Apex in the Developer Console:
TestEvent__e testEvent = new TestEvent__e();
List<TestEvent__e> toPublish = new List<TestEvent__e>();
toPublish.add(testEvent);
EventBus.publish(toPublish);
The Developer Console showed the logging for the anonymous apex, but nothing appeared for the trigger subscription to the event.
How do I see debug logging for Platform Event triggers?