Skip to content

Commit

Permalink
added as script to dump the config properties
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Feb 18, 2021
1 parent a6613ce commit f285b93
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/guide/src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f285b93

Please sign in to comment.