title: Not able to see STDERR Output with docker
body: <p>I'm running a php docker image (php:5.6-apache) which has apache's error and access logs redirected to STDERR and STDOUT respectively using symbolic links.</p>
  
  <p>When I run the docker image in the foreground or access the docker container logs, I can see the STDOUT output. But I don't see any errors (even when I generate php errors).</p>
  
  <p>Any idea why that is and how I can fix it?</p>
  
  <p>I'm running docker for Mac (but I don't think this makes any difference)</p>
  
  <p>Thanks</p>
  
  <pre><code>access.log -&gt; /dev/stdout
  error.log -&gt; /dev/stderr
  other_vhosts_access.log -&gt; /dev/stdout
  </code></pre>
  
  <p><strong>Edit / Solved:</strong>
  As @BMitch mentions and proves below, the STDERR redirection works fine. 
  The problem was with PHP configuration. If I logged an error with <code>error_log()</code>, it would get output to the log. But if I had a php error, like calling an undefined function, the error would never appear in the log. This seems a little inconsistent. In any case, ...</p>
  
  <p>I had to create a <code>php.ini</code> file in <code>/usr/local/etc/php/</code> and add these two parameters:</p>
  
  <pre><code>log_errors = On
  error_log = /var/log/apache2/error.log
  </code></pre>
  
  <p>and then restart the docker container. This caused all PHP errors to be logged and output to STDERR. See @German's answer for an example.</p>