title: log requests for apaches mod_proxy / mod_proxy_http
body: <p>i would like to set up conditional logging for requests done over apaches mod_proxy. is that possible and if so how?</p>
  
  <p>i already checked the documentation but did not find anything that i could use for setenvif</p>
  
  <p>i ask here and not on serverfault because there is a business application logic behind (traffic calcluations for users...)</p>
  
  <p>also i noticed that that proxy usernames in the log file.</p>
  
  <pre><code>proxy.2x.to:80 62.178.15.161 - peidel [06/Jun/2011:01:31:44 +0200] "GET http://proxy.2x.to/ HTTP/1.1" 200 1339 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" 
  </code></pre>
  
  <p>this is line from <code>/var/log/apache2/other_vhosts_access.log</code> which is generated by the default log defnitions: </p>
  
  <pre><code>LogFormat "%v:%p %h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
  </code></pre>
  
  <p><code>peidel</code> is the username.</p>
  
  <p>in the documentation it says:</p>
  
  <blockquote>
    <p>%l    Remote logname (from identd, if
    supplied). This will return a dash
    unless mod_ident is present and
    IdentityCheck is set On.</p>
  </blockquote>
  
  <p>now my question on this: can i rely on that? or is it possible that someone produces request with this identity information but who is not authenticated and produces log lines with an identity anyway?</p>