Akka.log-config-on-start does not work unless I set it in reference.conf

Tried it from command line via -D option, in application.conf and it only dumps the conf if I add it to reference.conf. I have the following:

val customConf =
ConfigFactory
.parseString(
“”"
akka.loglevel = DEBUG
log-config-on-start = on
“”")

private val config =
ConfigFactory
.load(customConf)
.withFallback(ConfigFactory.defaultApplication())
.withFallback(ConfigFactory.defaultReference())

What am I doing wrong? Thanks

1 Like

A colleague helped find the bug:

ConfigFactory.load()

implicitly does

ConfigFactory.defaultApplication().withFallback(ConfigFactory.defaultReference())

. However ConfigFactory.load(customConf) does

ConfigFactory.empty.withFallback(customConf).withFallback(ConfigFactory.defaultReference())

So, my above code becomes

ConfigFactory.empty.withFallback(customConf).withFallback(ConfigFactory.defaultReference()).withFallback(ConfigFactory.defaultApplication()).withFallback(ConfigFactory.defaultReference())