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
Running a Grails Application Using run-app Go to the application directory. For example, go to the as-install /grails/samples/helloworld directory. Run the grails run-app command. The grails run-app command starts the Enterprise Server in the background and runs the application in one step.
groovy, is for settings that are used when running Grails commands, such as compile, doc, etc. The second file, Config. groovy, is for settings that are used when your application is running. This means that Config. groovy is packaged with your application, but BuildConfig.
Go to start.grails.org and use the Grails Application Forge to generate your Grails project. You can choose your project type (Application or Plugin), pick a version of Grails, and choose a Profile - then click "Generate Project" to download a ZIP file. No Grails installation necessary!
1.2 If you want to stop your server (and app), you can, at the grails prompt, enter 'stop-app', which will stop the server and app.
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')
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With