title: Symfony2 500 error but no logs
body: <p>I have a "RealisationAwardsCategory" entity. When I want to persist this object , everything works perfectly. The form is ok, the view is displayed correctly, and database save works. However, when I want to see this entity in the show, edit or the index view, I have a blank page with a 500 error, but no log. I tried to see it in apache errors.log and app/logs/prod.log (i am in prod env,but i tried to see it in dev.log in case).</p>
  
  <p>This is my entity:</p>
  
  <pre><code>&lt;?php
  
  namespace VisualImmersion\AdminBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * RealisationAwardsCategory
   *
   * @ORM\Table()
   * @ORM\Entity(repositoryClass="VisualImmersion\AdminBundle\Entity\Repository\RealisationAwardsCategoryRepository")
   */
  class RealisationAwardsCategory
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="ID", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      /**
       * @var string
       *
       * @ORM\Column(name="name", type="string", length=255)
       */
      private $name;
  
  
      /**
       * @ORM\ManyToMany(targetEntity="RealisationAwards", mappedBy="RealisationAwardsCategories")
       */
      private $awards;
  
  
      public function __construct()
      {
          $this-&gt;awards = new \Doctrine\Common\Collections\ArrayCollection();
      }
  
      /**
       * Get id
       *
       * @return integer 
       */
      public function getId()
      {
          return $this-&gt;id;
      }
  
      /**
       * Set name
       *
       * @param string $name
       * @return RealisationAwardsCategory
       */
      public function setName($name)
      {
          $this-&gt;name = $name;
  
          return $this;
      }
  
      /**
       * Get name
       *
       * @return string 
       */
      public function getName()
      {
          return $this-&gt;name;
      }
  
      /**
       * Add Awards
       *
       * @param \VisualImmersion\AdminBundle\Entity\RealisationAwards $awards
       */
      public function addAwards(\VisualImmersion\AdminBundle\Entity\RealisationAwards $awards)
      {
          $this-&gt;awards[] = $awards;
      }
  
      /**
       * Get Awards
       *
       * @return \Doctrine\Common\Collections\ArrayCollection()
       */
      public function getAwards()
      {
          return $this-&gt;awards-&gt;toArray();
      }
  
      /**
       * Remove awards
       *
       * @param \VisualImmersion\AdminBundle\Entity\RealisationAwards $awards
       */
      public function removeAwards(\VisualImmersion\AdminBundle\Entity\RealisationAwards $awards)
      {
          $this-&gt;awards-&gt;removeElement($awards);
      }
  }
  </code></pre>
  
  <p>I have show view like this:</p>
  
  <pre><code>{% extends 'VisualImmersionAdminBundle::layout.html.twig' %}
  
  {% block body -%}
      &lt;h1&gt;Realisation Awards Category&lt;/h1&gt;
  
      &lt;table class="record_properties"&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  &lt;th&gt;Name&lt;/th&gt;
                  &lt;td&gt;{{ entity.name }}&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  
          &lt;ul class="record_actions"&gt;
      &lt;li&gt;
          &lt;a href="{{ path('realisationawardscategory_index') }}"&gt;
              Back to the list
          &lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;a href="{{ path('realisationawardscategory_edit', { 'id': entity.id }) }}"&gt;
              Edit
          &lt;/a&gt;
      &lt;/li&gt;
              &lt;li&gt;
                  &lt;form action="{{ path('realisationawardscategory_delete', { 'id': entity.id }) }}" method="post"&gt;
                      &lt;input type="hidden" name="_method" value="DELETE" /&gt;
                      {{ form_widget(delete_form) }}
                      &lt;button type="submit"&gt;Delete&lt;/button&gt;
                  &lt;/form&gt;
              &lt;/li&gt;
  &lt;/ul&gt;
  {% endblock %}
  </code></pre>
  
  <p>And this is my controller Show action:</p>
  
  <pre><code> /**
       * Finds and displays a RealisationAwardsCategory entity.
       *
       * @Route("/{id}", name="realisationawardscategory_show")
       * @Method("GET")
       * @Template()
       */
      public function showAction($id)
      {
          $em = $this-&gt;getDoctrine()-&gt;getManager();
  
          $entity = $em-&gt;getRepository('VisualImmersionAdminBundle:RealisationAwardsCategory')-&gt;find($id);
  
          if (!$entity) {
              throw $this-&gt;createNotFoundException('Unable to find RealisationAwardsCategory entity.');
          }
  
          $deleteForm = $this-&gt;createDeleteForm($id);
  
          return array(
              'entity'      =&gt; $entity,
              'delete_form' =&gt; $deleteForm-&gt;createView(),
          );
      }
  </code></pre>
  
  <p>My routes:</p>
  
  <pre><code>realisationawardscategory_index:
      path:  /realisationawardscategory
      defaults: { _controller: VisualImmersionAdminBundle:RealisationAwardsCategory:index }
  
  realisationawardscategory_show:
      path:  /realisationawardscategory/{id}
      defaults: { _controller: VisualImmersionAdminBundle:RealisationAwardsCategory:show }
      requirements:
        id: \d+
  
  realisationawardscategory_new:
      path:  /realisationawardscategory/new
      defaults: { _controller: VisualImmersionAdminBundle:RealisationAwardsCategory:new }
  
  realisationawardscategory_create:
      path:  /realisationawardscategory/create
      defaults: { _controller: VisualImmersionAdminBundle:RealisationAwardsCategory:create }
      requirements:
  
  
  realisationawardscategory_edit:
      path:  /realisationawardscategory/edit/{id}
      defaults: { _controller: VisualImmersionAdminBundle:RealisationAwardsCategory:edit }
      requirements:
        id: \d+
  
  realisationawardscategory_update:
      path:  /realisationawardscategory/update/{id}
      defaults: { _controller: VisualImmersionAdminBundle:RealisationAwardsCategory:update }
      requirements:
        id: \d+
  
  realisationawardscategory_delete:
      path:  /realisationawardscategory/delete/{id}
      defaults: { _controller: VisualImmersionAdminBundle:RealisationAwardsCategory:delete }
      requirements:
        id: \d+
  </code></pre>
  
  <p>I tried to use monolog to force entity display in my logs like this:</p>
  
  <pre><code>$logger = $this-&gt;get('logger');
  $logger-&gt;error('entity' . $entity);
  </code></pre>
  
  <p>But nothing displayed.</p>
  
  <p>I wish first to know what is the error in the show, and why no log is displayed.</p>
  
  <p>Thanks for your help :)</p>