grails / grails-core

The Grails Web Application Framework
http://grails.org
Apache License 2.0
2.79k stars 949 forks source link

GRAILS-10646: Grails 2.2.4 log4j configuration not working in Grails 2.3.x #2368

Closed graemerocher closed 9 years ago

graemerocher commented 11 years ago

Original Reporter: typoknig Environment: W7X64 Version: 2.3.1 Migrated From: http://jira.grails.org/browse/GRAILS-10646

I have the log4j configuration below. The intent of the configuration is to write the stdout to the console and to a file, and to write the stacktrace to a file. Both of the files should be written to my log directory. Everything works as desired when using Grails 2.2.4, but when using Grails 2.3.x the files are created in the appropriate directory, but the only thing ever written to the stdout file is:

{code} 2013-10-18 08:52:10,470 [main] INFO webxml.WebxmlGrailsPlugin - Loading default config file: class DefaultWebXmlConfig 2013-10-18 08:52:10,485 [main] WARN webxml.WebxmlGrailsPlugin - Did not find application config file: WebXmlConfig 2013-10-18 08:52:10,813 [main] INFO webxml.WebxmlGrailsPlugin - Loading default config file: class DefaultWebXmlConfig 2013-10-18 08:52:10,813 [main] WARN webxml.WebxmlGrailsPlugin - Did not find application config file: WebXmlConfig {code} and nothing is written to the stacktrace file when an error occurs. I though GRAILS-10585 might have fixed my issue so I waited for 2.3.1, but I'm still seeing the same problem. {code} // log4j configuration log4j = { appenders { rollingFile name: "stacktrace", file: "${logDirectory}${File.separator}${appName}_stacktrace.log".toString(), maxFileSize: "100MB" rollingFile name: "stdout_file", file: "${logDirectory}${File.separator}${appName}_stdout.log".toString(), maxFileSize: "100MB" }

warn    "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"

all     "grails.app.controllers.myApp",
        "grails.app.domain.myApp",
        "grails.app.services.myApp",
        "grails.app.taglib.myApp",
        "grails.app.conf.myApp",
        "grails.app.filters.myApp"

root {
    info "stdout", "stdout_file"
}

} {code}

graemerocher commented 10 years ago

graemerocher said: I tested this out with both run-app and deployment to Tomcat and it works fine. If you see further problems in 2.3.4, reopen the issue and attach an example that reproduces the issue

graemerocher commented 10 years ago

typoknig said: I am unable to reopen the issue to attach my bug report. If someone can reopen it I will attach the bug report.

graemerocher commented 10 years ago

typoknig said: Attached bug report.

graemerocher commented 10 years ago

kefir said: I've got the same problem on 2.3.9. I use Win7x64 too. JDK 1.7.0_60

graemerocher commented 10 years ago

kefir said: Is there a workaround for it?

graemerocher commented 10 years ago

kefir said: Sorry, it was my mistake. All works good for me.