From f285b93800b8805d536125a35b4cf81a87370577 Mon Sep 17 00:00:00 2001 From: Vladimir Orany Date: Thu, 18 Feb 2021 11:53:11 +0100 Subject: [PATCH] added as script to dump the config properties --- docs/guide/src/docs/asciidoc/index.adoc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/guide/src/docs/asciidoc/index.adoc b/docs/guide/src/docs/asciidoc/index.adoc index 25db5c60..29f22472 100644 --- a/docs/guide/src/docs/asciidoc/index.adoc +++ b/docs/guide/src/docs/asciidoc/index.adoc @@ -132,6 +132,27 @@ which will automatically load the configuration once the JAR is on classpath. org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.agorapulse.micronaut.grails.example.GrailsConfig ---- +== Troubleshooting + +=== Dumping Configuration Properties + +The configuration properties inside Grails may behave bit differently than inside Micronaut application. If you are using Grails Console plugin then you can dump all the properties available using the following script + +[source,groovy,indent=0,options="nowrap"] +---- +def mc = ctx.getBean(com.agorapulse.micronaut.grails.MicronautContextHolder).context +def env = mc.environment +def sources = env.propertySources + + +for (source in sources) { + println "$source.name:" + for (name in source) { + def value = source.get(name) + println " $name (${value?.getClass()}): ${String.valueOf(value)}" + } +} +---- = Links