Logging Configuration

41 views
Skip to first unread message

Robert Fischer

unread,
Jun 11, 2008, 10:38:32 PM6/11/08
to groo...@googlegroups.com
Can someone please share with me the magic chanting I need in order to do debug-level logging for
all my artefacts? It's something along the lines of grails.app="debug,stdout", but if I put that
before grails="error", the grails="error" eats it, and if I put it after, I get yelled at for trying
to call "app" on a string. Quoting "app" results in being able to run the code, but still not
getting any logging statements.

~~ Robert.

Jesse O'Neill-Oine

unread,
Jun 11, 2008, 10:43:52 PM6/11/08
to groo...@googlegroups.com
Here's my current config.  Don't ask me to explain it, though, cause I don't get it.  Easily one of the worst decisions the Grails team has made.  I do believe there is a way to go back to the xml, but I always seem to manage to limp through what I need so I've never looked into it.

log4j {
    appender.stdout = "org.apache.log4j.ConsoleAppender"
    appender.'stdout.layout'="org.apache.log4j.PatternLayout"
    appender.'stdout.layout.ConversionPattern'='[%r] %c{2} %m%n'
    appender.errors = "org.apache.log4j.FileAppender"
    appender.'errors.layout'="org.apache.log4j.PatternLayout"
    appender.'errors.layout.ConversionPattern'='[%r] %c{2} %m%n'
    appender.'errors.File'="stacktrace.log"
    rootLogger="error,stdout"
    logger {
        grails="error"
grails {
                        // This is the important bit for getting artefact logging
app="info"
app {
controller="debug"
service="debug"
domain="debug"
taglib="debug"
task="debug"
}
}
        StackTrace="error,errors"
        org {
            codehaus.groovy.grails.web.servlet="error"  //  controllers
            codehaus.groovy.grails.web.pages="error" //  GSP
            codehaus.groovy.grails.web.sitemesh="error" //  layouts
            codehaus.groovy.grails."web.mapping.filter"="error" // URL mapping
            codehaus.groovy.grails."web.mapping"="error" // URL mapping
            codehaus.groovy.grails.commons="info" // core / classloading
            codehaus.groovy.grails.plugins="error" // plugins
            codehaus.groovy.grails.orm.hibernate="error" // hibernate integration
            springframework="off"
            hibernate="off"
        }
    }
    additivity.StackTrace=false
--
----------------------------------------------------------
Jesse O'Neill-Oine // je...@refactr.com
Refactr LLC // http://refactr.com
mobile // 612-670-5037
----------------------------------------------------------

Robert Fischer

unread,
Jun 11, 2008, 10:46:12 PM6/11/08
to groo...@googlegroups.com
Forget the XML. I'll take the straight properties list. Copy/pasting "log4j." isn't really that
painful...

~~ Robert.

Reply all
Reply to author
Forward
0 new messages