I am trying to create 4 different logs to write to (using Tomcat). Here is the code (There is some odd stuff because I'm experimenting with it):
log4j = {
appenders {
rollingFile name:'infoLog', file:'/logs/info.log', threshold: org.apache.log4j.Level.INFO
rollingFile name:'warnLog', file:'/logs/warn.log', threshold: org.apache.log4j.Level.WARN
rollingFile name:'errorLog', file:'/logs/error.log', threshold: org.apache.log4j.Level.ERROR
rollingFile name:'debugLog', file:'/logs/debug.log', threshold: org.apache.log4j.Level.DEBUG
}
root {
info 'infoLog', 'errorLog', 'warnLog', 'debugLog'
error 'errorLog'
warn 'warnLog'
debug 'debugLog'
}
info 'grails.app'
error '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'
warn 'org.mortbay.log'
debug 'grails.app'
}
When I deploy and run the app, I get this in catalina.out:
log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: /logs/info.log (No such file or directory) at java.io.FileOutputStream.openAppend(Native Method) at java.io.FileOutputStream.(FileOutputStream.java:177) at java.io.FileOutputStream.(FileOutputStream.java:102)...
(I get that same message for each log I'm trying to create). Am I missing something?
Thanks