title: Log request and response with Event Listener in Symfony2
body: <p>I am trying to log a Request and Response with an Event listener in Symfony2.</p>
  
  <p>I've registered the following Service:</p>
  
  <pre><code>class LoggerListener
  {
  
      /**
       * @var \Doctrine\ODM\MongoDB\DocumentManager
       */
      private $documentManager;
  
      public function __construct(DocumentManager $documentManager)
      {
  
          $this-&gt;documentManager = $documentManager;
      }
  
      public function onKernelResponse(FilterControllerEvent $event)
      {
          $controller = $event-&gt;getController();
  
          if ( ! is_array($controller)) {
              return;
          }
  
          if ( ! $controller instanceof BaseAPIController) {
              return;
          }
  
  
          $log = new ServerRequestsLog();
          $log-&gt;setRequest($request);
          $log-&gt;setRequest($response);
  
  
      }
  } 
  </code></pre>
  
  <p>with this configuration:</p>
  
  <pre><code>  example.response_listener:
        class: Example\ServerBundle\EventListener\LoggerListener
        arguments: ["@doctrine.odm.mongodb.document_manager"]
        tags:
            - { name: kernel.event_listener, event: kernel.response, method: onKernelResponse }
  </code></pre>
  
  <p>How can I get the Request and the Response in this action? I think I can get the Request if I will inject the Request service. but what about the response?</p>