简体   繁体   中英

Cannot run web application because Tomcat cannot open stacktrace.log

I deployed a Grails web application using the Tomcat manager. It wouldn't start. I looked up the error and linked it to an error opening "stacktrace.log". I searched for errors on "stacktrace.log" and found an open Jira bug report/ticket on the Grails webpage.

http://jira.grails.org/browse/GRAILS-2730

(not) Conveniently, it's unresolved and there is no fix version.

Supposedly, the log4j configuration is in grails-app/conf/Config.groovy. All of the log4j stuff in my Config.groovy is commented out.

What's the quickest way (minimal configuration file editing) to disable stack trace logging?

If there are any configuration files in particular that I should post, just request them. I'd post all of my Tomcat and Grails config files, but there may be a lot of them and I don't know where all of the configuration files are.

You should just point the log file to a directory that the user that runs tomcat was write permission. See this post from the jira issue http://jira.grails.org/browse/GRAILS-2730?focusedCommentId=48061&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-48061

This should work (supposing that you have exported a war file from grails and published it trough tomcat, therefore you are in production environment)

environments {
    development {
        log4j.appender.'errors.File'="stacktrace.log"
    }
    production {
        log4j.appender.'errors.File'="/var/log/myapp/stacktrace.log"
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM