0

我将一个 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/classes 包含

org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler

但这也没有给我更多信息。

此外,我将 grails 应用程序的日志级别更改为调试,但也没有出现错误。目前我不知道如何从 tomcat 或应用程序中获取任何有用的信息,帮助我找到错误:(

干杯,

莫里茨

更新:

对于我尝试运行的环境,我的 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"
}
4

2 回答 2

0

查看所有日志文件 - catalina.out 很少有真正的问题。logs/localhost.2012-07-30.log 和 stacktrace.log 是你最好的选择。

于 2012-07-30T16:24:20.907 回答
-2

好吧,我终于找到了这个错误。不过,我找不到任何方法在日志中获取警告或错误。无论如何,我的错误在于我的应用程序的可搜索配置。

于 2012-07-30T17:45:08.987 回答