I cannot get grails log4j logging to work in Tomcat6. I previously thought the problem had to do with Production mode, but now I believe the issue is tomcat.
I have a l
It could be the way you define your environment in the DSL config I have similar setup: Grails 1.3.7 + Tomcat 6.0 this works great for me.
log4j = {
environments {
production {
appenders {
def catalinaBase = System.properties.getProperty('catalina.base')
if (!catalinaBase) catalinaBase = '.'
def logDirectory = "${catalinaBase}/logs"
/* log file appender config & layout */
appender new DailyRollingFileAppender(
name:"logfile",
file:"$logDirectory/logfilename.log",
layout:pattern(conversionPattern: "%d{yy.MM.dd HH:mm:ss} [%t] %-5p %c %x - %m%n"),
datePattern:"'.'yyyy-MM-dd",
threshold: org.apache.log4j.Level.ERROR
}
/* type of errors to log */
error 'org.codehaus.groovy.grails.scaffolding.view.ScaffoldingViewResolver',
'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', // class
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate
'org.springframework', // spring
'org.hibernate', // hibernate
/* jetty, not required on tomcat */
warn 'org.mortbay.log'
/* root logger config */
root {
debug 'logfile'
additivity = true
}
}//production
development{
/* add config for development evn*/
}
test{
/* add config for test env*/
}
}//log4j