I am trying to deploy a grails application on JBoss EAP, the problem is that no output from my application is logged except for stdout and stderr. I really don't understand how the logging works in this case since jboss uses some internal logging system and grails uses log4j.
This is my logging configuration in standalone.xml:
<subsystem xmlns="urn:jboss:domain:logging:1.1">
<console-handler name="CONSOLE">
<level name="INFO"/>
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
</console-handler>
<periodic-rotating-file-handler name="FILE">
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="server.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler>
<logger category="com.arjuna">
<level name="WARN"/>
</logger>
<logger category="org.apache.tomcat.util.modeler">
<level name="WARN"/>
</logger>
<logger category="sun.rmi">
<level name="WARN"/>
</logger>
<logger category="jacorb">
<level name="WARN"/>
</logger>
<logger category="jacorb.config">
<level name="ERROR"/>
</logger>
<root-logger>
<level name="INFO"/>
<handlers>
<handler name="CONSOLE"/>
<handler name="FILE"/>
</handlers>
</root-logger>
</subsystem>
Which is default.
This log4j configuration is in my Config.groovy:
// log4j configuration
log4j = {
// Example of changing the log pattern for the default console appender:
//
//appenders {
// console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
//}
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'
all additivity: false, console: [
'grails.app.controllers.com.redhat.theses',
'grails.app.domain.your.com.redhat.theses',
'grails.app.services.com.redhat.theses',
'grails.app.taglib.com.redhat.theses',
'grails.app.conf.com.redhat.theses',
'grails.app.filters.com.redhat.theses'
]
}
I really don't understand this logging stuff, it is so confusing, all I want is to log at least all errors, for starters. One would think that such a crucial feature works by default.
If I set this property when starting JBoss:
./standalone.sh -Dorg.jboss.as.logging.per-deployment=false
it works exactly as I want. But is it all right? Why do I have to set this property in order to get such a crucial function as logging, really?
Thank you so much for any help, I am sorry if I sound a bit arrogant, I have been trying to figure this out for hours and I am still where I was at the beginning.