title: Log4j - Add filter to appender in Groovy
body: <p>I don't really have any relevant groovy experience so far and now I am trying to log only a few messages into a file from my grails app. I have set up log4j (1.2.17) in <code>Config.groovy</code> and a simple file appender is up and running.</p>
  <p>Now what I want to do is filter the messages and only log the ones that match a regex. I think I should use a regexfilter for this, but I am simply unable to add the filter to the mentioned appender.</p>
  <p>What I have now</p>
  <pre><code>    log4j = {
          appenders {
              console....
              file name: 'file', file: '*.log', layout: pattern(conversionPattern: &quot;...&quot;), filter: 
                  regexFilter(pattern: &quot;...&quot;, onMatch: &quot;ACCEPT&quot;, onMismatch: &quot;DENY&quot;)
          }
      }
  </code></pre>