title: Why not to enable Symfony debug tools in production?
body: <p>I often find really useful to convert php errors to exceptions registering callbacks to <code>set_error_handler</code> and <code>register_shutdown_function</code>, so i decided to give a try to some more solid solution, namely the Symfony Debug component. However, in the <a href="http://symfony.com/doc/current/components/debug/introduction.html" rel="nofollow">introduction page</a> they warn:</p>
  
  <blockquote>
    <p>You should never enable the debug tools in a production environment as they might disclose sensitive information to the user.</p>
  </blockquote>
  
  <p>Enabling the debug component basically means to call <code>Symfony\Component\Debug\Debug::enable()</code>, which in turn <a href="http://api.symfony.com/2.3/Symfony/Component/Debug/Debug.html" rel="nofollow">registers an error handler and an exception handler</a>. This also let the developer choose to <code>$displayErrors</code>, which means</p>
  
  <blockquote>
    <p>Whether to display errors (for development) or just log them (for production)</p>
  </blockquote>
  
  <p>So one could simply <a href="https://github.com/symfony/Debug/blob/master/ErrorHandler.php#LC108" rel="nofollow">register some custom logger</a> and use the debugger safely in production, isn't it?</p>
  
  <p>I'd really like to start using this component to safely manage error situations in php, just because i was starting to reinvent the wheel, writing something really close to that (except for quality of course :D), but that advice not to use it in production worries me a little: what kind of problems could arise from it in your opinion?</p>
  
  <p>By the way, displaying errors means this: <a href="https://github.com/symfony/Debug/blob/master/ErrorHandler.php#LC152" rel="nofollow"><code>$exceptionHandler = set_exception_handler('var_dump');</code></a>, so it should be perfectly fine to set <code>$displayErrors</code> on during development, and then turn it off in production, keeping the safety of having an error handler catching all errors as exceptions and logging them down.</p>
  
  <p>So how do you use this component in production (if you do it at all)?</p>