May 1, 2024
thanks for your reply, I really enjoy seeing someone pay attention to details
The examples in this article are simple, and there isn't much going on in the EventSubscriber. But in my apps, things are usually more complicated. That's why I like to put logs in the subscriber instead of the listeners.
Here's a simple rule I follow, and it's not just for logs but for any work with listeners and subscribers:
- I use a listener if the task is easy, usually 1 single event
- I use a subscriber if the task is complex and its related to multiple components