Below is my logging configuration. It is logging exactly what I want, but it is only logging it to a file. I would like to see the same information on the console. I have tried several variations, but with every variation I can only get the information logged to either the console or a file, not both.
def appName = grails.util.Metadata.current.'app.name'
def catalinaBase = System.properties.getProperty('catalina.base')
catalinaBase = catalinaBase ?: "."
def logDirectory = "${catalinaBase}${File.separator}logs${File.separator}${appName}"
// log4j configuration
log4j = {
appenders {
rollingFile name: 'stdout', file: "${logDirectory}${File.separator}${appName}.log".toString(), maxFileSize: '100MB' // Use the same file for stdout and stacktrace
rollingFile name: 'stacktrace', file: "${logDirectory}${File.separator}${appName}.log".toString(), maxFileSize: '100MB' // Use the same file for stdout and stacktrace
}
warn 'org.codehaus.groovy.grails.web.servlet', // controllers
'org.codehaus.groovy.grails.web.pages', // GSP
'org.codehaus.groovy.grails.web.sitemesh', // layouts
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
'org.codehaus.groovy.grails.web.mapping', // URL mapping
'org.codehaus.groovy.grails.commons', // core / classloading
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate'
all 'grails.app.controllers.test',
'grails.app.domain.test',
'grails.app.services.test',
'grails.app.taglib.test',
'grails.app.conf.test',
'grails.app.filters.test'
}