Include $_POST, $_GET, $_SERVER values in PHP Error Log
<p>I have code like this</p>

<pre><code>try {
    header("Location: http://www.google.com\n-abc");
}
catch (Exception $e) {
    error_log(print_r($_POST, true));
    error_log(print_r($_GET, true));
    error_log(print_r($_SERVER, true));
}
</code></pre>

<p>Without the try {} catch {} block, I can see the POST, GET and SERVER variables in my error_log, but with the try {} catch {} block, I only see the default PHP error. </p>

<ol>
<li>Is there a way to show the POST, GET, and SERVER variables in a try {} catch {} block?</li>
<li>Is there a way to have PHP include POST, GET, and SERVER variables for ALL errors that get logged to file and not just wherever I have added error_log(print_r($_POST, true)); ....?</li>
</ol>
