title: Output log of single class to file in Grails
body: <p>I'm trying to redirect the log4j output of a single package to a file. My configuration is as follows:</p>
  
  <pre><code>log4j = {
  
      appenders {
          console name:'stdout'
          appender new DailyRollingFileAppender(
                  name: 'audit',
                  datePattern: "'.'yyyy-MM-dd",
                  fileName: "${userHome}/${applicationName}.log",
                  layout: pattern(conversionPattern: '%d [%t] %-5p %c{2} %x - %m%n')
          )
      }
  
      root {
          error 'stdout'          
      }
  
      error   'org.codehaus.groovy.grails.web.servlet',        // controllers
              'org.codehaus.groovy.grails.web.pages',          // GSP
              'org.codehaus.groovy.grails.web.sitemesh',       // layouts
              'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
              'org.codehaus.groovy.grails.web.mapping',        // URL mapping
              'org.codehaus.groovy.grails.commons',            // core / classloading
              'org.codehaus.groovy.grails.plugins',            // plugins
              'org.codehaus.groovy.grails.orm.hibernate',      // hibernate integration
              'org.springframework',
              'org.hibernate',
              'net.sf.ehcache.hibernate',
              'StackTrace',
              'org.hibernate.type',
              'org.hibernate.SQL',
              'Hibernate',
              'org.hibernate.type.descriptor.sql.BasicBinder'
  
      debug   'grails.app' // set logging for all grails artifacts
  
      info    audit:
              'my.package.name', additivity: false        
  }
  </code></pre>
  
  <p>Somehow the logging of the <code>my.package.name</code> package is not written to the file but to <code>stdout</code>. When I put the <code>audit</code> logger in my <code>root</code> config the logging gets written to the file but the logging of the other classes is also written in this file, which I don't want.</p>
  
  <p>I want ONLY the logging output of <code>my.package.name</code> to be written to the file, all other logging can go to <code>stdout</code>. I've tried playing with the <code>additivity</code> but I can't figure it out.</p>