In this recent post to the ThisData blog Nick Malcolm shows you a method for subscribing to the events that the Symfony framework throws during the course of its execution with simple listeners.
Symfony is a popular web framework for PHP apps, and comes with a powerful event notification system which fires events when almost anything happens inside the system. Hooking in to these events can add advanced functionality to your app.
The most common way to listen to an event is to register either an event "listener", or an event "subscriber". We're going to use Subscribers. In this post we'll create a Subscriber which listens for successful and unsuccessful Log In events, and responds by sending information to ThisData.
He starts with a Symfony demo application and show the creation of a basic subscriber to specifically listen to the security events. In this case they're only looking for authentication failures and interactive logins. He walks through what the subscriber code is doing step-by-step and includes the registration of the subscriber. This includes an update to send the event results over to the ThisData service for easier ingestion and reporting. This final step isn't a requirement to get the subscriber working, it's just an optional step they've provided as one method to handle the eventing output.