开发者

Where can I find the Tomcat log written out by 'grails run-app'?

开发者 https://www.devze.com 2022-12-29 08:24 出处:网络
While running grails app in \'dev\' mode using \'grails run-app\', where is the 开发者_运维问答default Tomcat log file located written out by the embedded Tomcat come with Grails (1.2.2) installation?

While running grails app in 'dev' mode using 'grails run-app', where is the 开发者_运维问答default Tomcat log file located written out by the embedded Tomcat come with Grails (1.2.2) installation?


There isn't a default log file, the output to the log gets written to stdout.


Should be $CATALINA_HOME/logs/catalina.out


You have to define an log4j root logger in your Config.groovy like this:

log4j = {
    appenders {
        // console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
        // file name:'file', file:'app.log'
    }

    // By default, messages are logged at the warn level to the console and the app.log
    root {
        warn 'stdout'
        // warn 'stdout','file'
        additivity = true
    }
...
}

This example also shows how to configure the logging pattern. Also it shows how to configure file logging. The appenders section is optional and just needed to configure the logging pattern or file logger.

0

精彩评论

暂无评论...
验证码 换一张
取 消