I have a spring boot java service running in a google kubernetes managed container engine. The Java service logs via the slf4j api (and logs are forwarded to google stackdriver, but that's not in scope of this question).
I can change the logging level by changing the kubernetes deployment file:
spec:
template:
spec:
containers:
env:
- name: JAVA_OPTS
value: -Xmx1g -Dlogging.level.com.example=DEBUG
This works, but it requires me to redeploy the service (restart the container by applying an updated deloyment yaml
file) in order to change log level. If I compare with working with a "regular" tomcat server running a regular war-file, it can put a file-watch to a logback.xml
-file and changes in this file takes effect on the logging without having to restart the tomcat. Is there a similar way to control log levels in runtime in kubernetes managed spring boot services?