我将一个grails 2应用程序部署到tomcat7中,它不会启动。我尝试了很多东西来从catalina.out或我的应用程序日志中获取任何信息,但我得到的只是
Jul 30, 2012 5:47:40 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.28
Jul 30, 2012 5:47:40 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor /etc/tomcat7/Catalina/localhost/manager.xml
Jul 30, 2012 5:47:41 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor /etc/tomcat7/Catalina/localhost/host-manager.xml
Jul 30, 2012 5:47:41 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/ROOT.war
Jul 30, 2012 5:47:41 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jul 30, 2012 5:47:49 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Jul 30, 2012 5:47:49 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
Jul 30, 2012 5:47:49 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-127.0.0.1-8081"]
Jul 30, 2012 5:47:49 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8372 ms
我已经将logging.properties放入包含
的/ var / lib / tomcat / webapps / myApp / WEB-INF / classesorg.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler
但这也没有给我任何更多信息。
另外,我将grails app的loglevel更改为debug,但也没有出现错误。目前我不知道如何从tomcat或应用程序中获取任何有用的信息,帮助我找到错误:(
干杯,
Moritz的
更新
对于我正在尝试运行的环境,我的Config.groovy看起来像这样:
staging {
def logDirectory = "/var/log/myApp"
log4j = {
appenders {
rollingFile name: 'stacktrace', file: "${logDirectory}/stacktrace.log".toString(), maxFileSize: '10MB'
rollingFile name: 'myLog', file: "${logDirectory}/myApp_debug.log".toString(), maxFileSize: '10MB'
}
root {
// change the root logger to myLog file
debug 'myLog'
}
debug 'grails.app'
debug 'org.codehaus.groovy.grails.commons' // Core artifact information such as class loading etc.
debug 'org.codehaus.groovy.grails.web' //Grails web request processing
debug 'org.codehaus.groovy.grails.web.mapping' // URL mapping debugging
debug 'org.codehaus.groovy.grails.plugins' // Log plugin activity
warn 'grails.spring' // See what Spring beans Grails and plugins are defining
debug 'org.springframework' // See what Spring is doing
debug 'org.hibernate' // See what Hibernate is doing
debug 'org.codehaus.groovy.grails.web.servlet' // controllers
debug 'org.codehaus.groovy.grails.web.pages' // GSP
info 'org.apache.catalina' // tomcat
// set level for my messages; this uses the root logger (and thus the tomcatLog file)
debug 'myApp_debug.log'
}
grails.serverURL = "someUrl"
}
答案 0 :(得分:0)
查看所有日志文件 - catalina.out很少有真正的问题。 logs / localhost.2012-07-30.log和stacktrace.log是你最好的选择。
答案 1 :(得分:-2)
好吧所以我终于找到了这个bug。我找不到任何方法在日志中获得警告或错误。无论如何,我的错误在我的应用程序的可搜索配置中撒谎。