简体   繁体   English

由于Tomcat无法打开stacktrace.log,因此无法运行Web应用程序

[英]Cannot run web application because Tomcat cannot open stacktrace.log

I deployed a Grails web application using the Tomcat manager. 我使用Tomcat管理器部署了Grails Web应用程序。 It wouldn't start. 它不会开始。 I looked up the error and linked it to an error opening "stacktrace.log". 我查找了错误,并将其链接到打开“ stacktrace.log”的错误。 I searched for errors on "stacktrace.log" and found an open Jira bug report/ticket on the Grails webpage. 我在“ stacktrace.log”上搜索错误,并在Grails网页上找到了一个打开的Jira错误报告/票证。

http://jira.grails.org/browse/GRAILS-2730 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. 据说,log4j配置位于grails-app / conf / Config.groovy中。 All of the log4j stuff in my Config.groovy is commented out. 我的Config.groovy中的所有log4j内容都被注释掉了。

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. 我会发布所有的Tomcat和Grails配置文件,但是可能有很多,而且我不知道所有配置文件在哪里。

You should just point the log file to a directory that the user that runs tomcat was write permission. 您应该只将日志文件指向运行tomcat的用户具有写权限的目录。 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 请参阅jira问题的这篇文章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) 这应该可以工作(假设您已经从grails中导出了war文件并通过tomcat发布了它,因此您处于生产环境中)

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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