Grails logging not working

grails, logging

Solution

Start like this:

log4j = {
    root {
        debug()
    }
}

You should get a lot of logging to your console. Then (if that works), try this:

log4j = {
    info "grails.app"
}

Among the output you should see `log.info` from your controllers and services. Then slowly add to the config.

Don't forget to restart between the changes in `Config.groovy`.

Problem

I'm developing a grails 2.3.4 application and had some logging problems. Actually, I couldn't configure any logging at all (accordingly to http://grails.org/doc/latest/guide/conf.html#logging) - had no output result. After some brainstorming I figured out, that the grails documentation configs are not working for my project. Nevertheless, some configs variation worked fine (I saw the result on my screen): ``` log4j = { appenders { console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n') } root { error 'stdout' additivity = true } 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' debug stdout: ['edu.dm'] ``` } The configs like: ``` debug stdout: ['grails.app.services', 'grails.app.services.edu'] debug stdout: ['grails.app.controllers', 'grails.app.controllers.edu'] ``` failed. I would be extremely thankful, if anyone could explain my mistakes or share a link with an explanation. The whole project can be found here: https://github.com/AlexDavljatov/EduDM/tree/master/LoggingMiniProject Many thanks in advance. Kind regards, Alexander Davliatov.

Original source