Grails Log4J File appender does not write to file

I can't seem to get the file log4j file to write to the file in the grails application. The file is created in the directory that I expect, when I start in debug mode, I see that the log method is being called, but still no results in the file. Application code and log code below. I made log4j configuration as simple as possible to fix any complex problems. Ideas?

abstract class BaseJob {

abstract def executeTask()
def execute() {
    beginTask()
    executeTask()
    endTask()
}
def beginTask()
{
    log.error("Started task: " + this.class)
}
def endTask()
{
    log.error("Finished task: " + this.class)
}
}

log4j = {
// Example of changing the log pattern for the default console
// appender:
//
appenders {
    //console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
    file name:'myLogger', file:"all.log", immediateFlush:'true', threshold:org.apache.log4j.Level.DEBUG

}

debug 'grails.app'

}

+3
source share
1 answer

according to the documentation http://grails.org/doc/2.1.0/guide/conf.html#logging you should use:

debug myLogger: 'grails.app'

or for multiple registrars

debug myLogger: ['grails.app', 'org.apache']

working on grails 2.0.4

+3
source

All Articles