Spring Boot 2.2.6-RELEASE
In my application.yml
, I have this line :
logging.config: classpath:my-logback-config.xml
This works well, spring get its config nicely
In my my-logback-config.xml
I have this line :
<springProperty name="LOG_HOST" source="config.logHost" />
<springProperty name="LOG_PORT" source="config.logPort" />
Again, this works well, it get its value from an external config file, which is defined in a ENV variable
SPRING_CONFIG_ADDITIONAL_LOCATION=file:/my-env.properties
But when I enable Spring Cloud Kubernetes, this fails, with an UnknowHostException : "LOG_HOST_IS_UNDEFINED" cannot be resolved.
(the value of LOG_HOST
is used to setup a network appender)
Why does enabling Spring Cloud Kubernetes change the behavior of logging initialization?
It seem that values from SPRING_CONFIG_ADDITIONAL_LOCATION are not loaded yet.
I can't load this value from a configMap, since Spring Cloud Kubernetes has not been initialized at the moment logging is being initialized.