title: Log htaccess apache access user stored in .htpasswd in a file
body: <p>I will use my <em>.htaccess</em> in order to store users crendtials with this config :</p>
  
  <pre><code>&lt;FilesMatch "secret.php"&gt;
   AuthName "Member Only"
   AuthType Basic
   AuthUserFile /home/realboss/.htpasswd
   require valid-user
  &lt;/FilesMatch&gt;
  </code></pre>
  
  <p>I have a <em>.htpasswd</em> file with these fake credentials :</p>
  
  <pre><code>admin:$fdslkjhdfsqklbhjndfsqbkjln
  boss:$fdslkjhdfsqklbhjndfsqbkjln
  staff_boss:$fdslkjhdfsqklbhjndfsqbkjln
  </code></pre>
  
  <p>I want to log user connection in a file. An example logfile that I want : </p>
  
  <p>File <em>apache_connection.log</em>:</p>
  
  <pre><code>secret.php admin 2018-08-23 08:20:10
  secret.php staff_boss 2018-08-19 11:35:41
  ...
  </code></pre>
  
  <p><a href="https://httpd.apache.org/docs/2.4/fr/howto/auth.html" rel="nofollow noreferrer">Apache doc</a> don't give a way to do that...</p>