Commits ------- 9d8e6f6 [FrameworkBundle] Changed TraceableEventDispatcher to log calls to event listeners _before_ actually calling them Discussion ---------- [FrameworkBundle] Log calls to event listereners _before_ calling them The current implementation of `TraceableEventDispatcher` logs calls to event listeners _after_ actually calling them. This leads to strange logs when an event listener triggers another event. For example, if I attach some `LoginListener` to the `security.interactive_login`-event, the log will look something like this: <pre> ... User "myusername" has been authenticated successfully Notified event "security.interactive_login" to listener "MyVendor\MyBundle\EventListener\LoginListener::onSecurityInteractiveLogin". Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". ... </pre> From the logs it looks like the `kernel.request` event was fired after the user was authenticated, whereas it was actually the listener to `kernel.request` that caused the user to be authenticated. By logging the call to the event listener _before_ calling it, the logs will look like this: <pre> ... Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". Notified event "security.interactive_login" to listener "MyVendor\MyBundle\EventListener\LoginListener::onSecurityInteractiveLogin". User "myusername" has been authenticated successfully ... </pre> In my opinion this makes the causal relationship between the events clearer. --------------------------------------------------------------------------- by stof at 2011/07/24 11:18:48 -0700 :+1: for this.
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|