title: How to change log level on a Java slf4j logger in a kubernetes managed service in runtime?
body: <p>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).</p>
  
  <p>I can change the logging level by changing the kubernetes deployment file:</p>
  
  <pre><code>spec:
    template:
      spec:
        containers:
          env:
          - name: JAVA_OPTS
            value: -Xmx1g -Dlogging.level.com.example=DEBUG
  </code></pre>
  
  <p>This works, but it requires me to redeploy the service (restart the container by applying an updated <code>deloyment yaml</code> 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 <code>logback.xml</code>-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?</p>