Alex Rivera | Logout

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

Asked 2010-05-05T00:36:19.767
15

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?

Edit
Report

2 Answers

6

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

answered 2010-05-05T05:42:05.247
0

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.

answered 2013-04-03T19:18:55.570

Your Answer