You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been strugging in grails with the question of how to set an external logback.groovy location. I don't want to use -D on the command line because if you deploy in Tomcat that forces all apps to share the one config.
So I thought I'd found the solution in this external-config library. All I should have to do is set the location in an external config:
but it doesn't seem to get picked up. Note that I haven't set the parameter logging.config anywhere inside my app, or in application.yml . But I do have my application.yml set to pickup my-config.yml. I know this is working because it starts on 8082 and not the default 8080.
So if I run my app:
java -jar myapp.jar
and if logback.groovy doesn't exist, then it starts fine, no complaints. But if I do: LOGGING_CONFIG=logback.groovy java -jar myapp.jar
It dies because logback.groovy doesn't exist.
Or in other words, setting logging.config using one of the normal grails mechanisms to some file that isn't there, crashes as expected. Setting it using this plugin does not.
Or in other words, this plugin is broken with regards to setting logging config.
I'm guessing this is because this plugin does whatever it does after logging has been initialized. But it really needs to do it earlier in the startup sequence. I think one of the spring callbacks should be able to do that, but I was hoping not to have to figure all that out by using this plugin.
The text was updated successfully, but these errors were encountered:
@chrisbitmead The plugin is as such not broken, but does not work for your particular use case, and it has not been on my radar.
If you can come up with a solution, pull-requests are always welcomed
I've been strugging in grails with the question of how to set an external logback.groovy location. I don't want to use -D on the command line because if you deploy in Tomcat that forces all apps to share the one config.
So I thought I'd found the solution in this external-config library. All I should have to do is set the location in an external config:
my-config.yml:
but it doesn't seem to get picked up. Note that I haven't set the parameter logging.config anywhere inside my app, or in application.yml . But I do have my application.yml set to pickup my-config.yml. I know this is working because it starts on 8082 and not the default 8080.
So if I run my app:
java -jar myapp.jar
and if logback.groovy doesn't exist, then it starts fine, no complaints. But if I do:
LOGGING_CONFIG=logback.groovy java -jar myapp.jar
It dies because logback.groovy doesn't exist.
Or in other words, setting logging.config using one of the normal grails mechanisms to some file that isn't there, crashes as expected. Setting it using this plugin does not.
Or in other words, this plugin is broken with regards to setting logging config.
I'm guessing this is because this plugin does whatever it does after logging has been initialized. But it really needs to do it earlier in the startup sequence. I think one of the spring callbacks should be able to do that, but I was hoping not to have to figure all that out by using this plugin.
The text was updated successfully, but these errors were encountered: