Grails 1.1 has changed logging setup completely, introducing a new DSL closure. For the most part it’s cool, but the syntax looks the same sometimes for both log level and appender assignments. I’ve updated my previous posts on debug logging and stacktrace.log. For the record, included below is the complete log4j closure I’m now using for a new Grails 1.1 project (or download it). Append this to the default Config.groovy file.
(more…)
Posts Tagged ‘logging’
Grails stacktrace.log
Tuesday, September 30th, 2008Grails 1.0.x started creating a stacktrace.log file in the directory where the servlet container starts. In a development environment, using grails run-app, that’s simple enough— it appears in the top level of your application. In a production environment, this becomes a problem. Your production container (e.g. Tomcat) may start someplace where it can’t create files, like /. Thus you get exceptions sent to your container’s log files like:
java.io.FileNotFoundException: stacktrace.log (Permission denied)
Also, messages are appended to stacktrace.log– so it will continue to grow if you don’t do something about it. One option is to change where your container starts, e.g. have the startup script change to its logs directory. You can also configure your grails app to change the location of the stacktrace.log file or turn it off completely.
(more…)
Grails logging
Wednesday, September 24th, 2008To turn on display of debug log messages in Grails 1.0.2, add this to the bottom of grails-app/conf/Config.groovy:
environments {
development {
log4j {
logger {
grails."app"="debug,stdout"
//grails="debug,stdout" // maybe need this too
}
}
}
}
Info on other versions continues below.
(more…)