views:

80

answers:

1

Since calling run-app uses the tomcat-plugin in grails, how do I modify the grails AccessLogValve in the server.xml when it does not exists?

I only need this for development since in production I will just deploy the war to tomcat.

Thanks In Advance

+1  A: 

You can configure it in a callback for the 'ConfigureTomcat' event in scripts/_Events.groovy:

import org.apache.catalina.valves.AccessLogValve

eventConfigureTomcat = { tomcat ->
 tomcat.host.addValve new AccessLogValve(
  directory: basedir, prefix: 'localhost_access_log.', pattern: 'common')
}
Burt Beckwith