We can place logback.xml into the root folder of our project and then pass it when running up the application
grails -Dlogback.configurationFile=logback.xml run-appThe biggest disadvantage is: it is annoying to always include additional properties in the command line and it also means you need to tell that to the new developers. Also, it is not following Grails principle "convention over configuration".
We need to provide the default configuration for the development mode if logback.configurationFile property is not set.
So we hook after compilation event as follows. Create or open scripts/_Events.groovy file in your project folder.
Here is the content of _Events.groovy file.
In this example logback-config-dev.xml is ment to be stored in the project root folder.
No comments:
Post a Comment