title: Logging mod_rewrite on Apache 2.2
body: <p>I am trying to troubleshoot mod_rewrite on Apache2.2.15 operating on Centos 6.5.  My <code>httpd.conf</code> file is as follows:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName somesite.com
      DocumentRoot /var/www/somesite/html
      &lt;Directory "/var/www/somesite/html"&gt;
          &lt;IfModule mod_rewrite.c&gt;
              RewriteEngine On
              RewriteLog /var/log/httpd/rewrite.log
              RewriteLogLevel 3
          &lt;/IfModule&gt;
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I keep on getting the following error where line 1044 corresponds to <code>RewriteLog /var/log/httpd/rewrite.log</code>.</p>
  
  <pre><code>[root@devserver httpd]# service httpd restart
  Stopping httpd:                                            [  OK  ]
  Starting httpd: Syntax error on line 1044 of /etc/httpd/conf/httpd.conf:
  RewriteLog not allowed here
                                                             [FAILED]
  [root@devserver httpd]#
  </code></pre>
  
  <p>I can add <code>RewriteLog /var/log/httpd/rewrite.log</code> to the main section (not virtual host) of httpd.conf, but nothing gets logged from the virtual host.</p>
  
  <p>How do I log mod_rewrite transactions?</p>