title: Developing php with docker
body: <p>I'm developing a wordpress site with docker. I need to write php code, so I want to see my php errors with apache error logs.</p>
  
  <p>In a non docker environment I would do something like this:</p>
  
  <pre><code>tail -100f /var/log/apache2/error.log
  </code></pre>
  
  <p>With docker scenario, if I log in my apache container my apache logs are old and empty:</p>
  
  <pre><code>$ docker exec -t -i apache /bin/bash
  root@d47b168d8c4b:/var/www/html# cd /var/log/apache2/
  root@d47b168d8c4b:/var/log/apache2# ls -alrt
  total 8
  -rw-r-----  1 www-data www-data    0 Apr 30 04:34 other_vhosts_access.log
  -rw-r-----  1 www-data www-data    0 Apr 30 04:34 error.log
  -rw-r-----  1 www-data www-data    0 Apr 30 04:34 access.log
  drwxr-x---  2 www-data www-data 4096 Apr 30 04:34 .
  drwxr-xr-x 11 root     root     4096 Apr 30 05:58 ..
  root@d47b168d8c4b:/var/log/apache2# 
  </code></pre>
  
  <p>Maybe logs are in a different place so I go to apache virtual hosts configuration and sites-enabled folder is empty!</p>
  
  <p>In sites-availabe I have this configuration:
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined</p>
  
  <p>where ${APACHE_LOG_DIR} is /var/www/apache2</p>
  
  <p>My wordpress image is the official one: <a href="https://registry.hub.docker.com/_/wordpress/" rel="nofollow">https://registry.hub.docker.com/_/wordpress/</a>
  I look at the dockerfile searching for hints but I saw no configuration related. It's based on FROM php:5.6-apache so I look also that dockerfile but I don't get any log configuration there.</p>
  
  <p>Currently this is the only way I can get logs:</p>
  
  <pre><code>docker logs apache
  </code></pre>
  
  <p>Where apache is my container-name. However I only get apache access-logs, I don't get any error logs</p>