title: apache access log and do not log images
body: <p>I have this log format for Apache</p>
  
  <pre><code>CustomLog /var/log/virtualmin/test_access_log "combined" env=!forwarded
  CustomLog /var/log/virtualmin/test_access_log "proxy" env=forwarded
  LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
  SetEnvIf X-Forwarded-For ^.*\..*\..*\..* forwarded
  </code></pre>
  
  <p>I do not want to log requested images files so I use this:</p>
  
  <pre><code>SetEnvIf Request_URI \.jpg$ jpg-image
  CustomLog /var/log/virtualmin/test_access_log "combined" env=!jpg-image
  </code></pre>
  
  <p>The images requests keep getting logged until I comment these 2 lines: </p>
  
  <pre><code>CustomLog /var/log/virtualmin/test_access_log "combined" env=!forwarded
  CustomLog /var/log/virtualmin/test_access_log "proxy" env=forwarded
  </code></pre>
  
  <p>It seems like an incompatibility with the forwarded and the jpg-image.
  I hope somebody knows a shortcut to make it work.</p>