title: Change log level on runtime for containers
body: <p>im using <a href="https://github.com/sirupsen/logrus" rel="nofollow noreferrer"><code>logrus</code></a> for logging for out applications which run on K8S
  we have env variable which we can set the <code>log-level</code> and change it when we restart out application
  our applications is running with docker containers on k8s
  Now we want to change the log-level on runtime, i.e. don’t restart the container and change it 
  when it’s running and with this we can change it from <code>error</code> to <code>debug</code>, I think this 
  is legitimic request but didn’t find any reference or any open source which doing this, any idea? </p>
  
  <pre><code>package logs
  
  import (
      "fmt"
      "os"
  
      "github.com/sirupsen/logrus"
  )
  
  const (
      AppLogLevel = “APP_LOG_LEVEL"
      DefLvl = "info"
  )
  
  
  var Logger *logrus.Logger
  
  
  func NewLogger() *logrus.Logger {
  
      var level logrus.Level
      lvl := getLogLevel()
      // In case level doesn't set will not print any message
      level = logLevel(lvl)
      logger := &amp;logrus.Logger{
          Out:   os.Stdout,
          Level: level,
      }
      Logger = logger
      return Logger
  }
  
  // use from env
  func getLogLevel() string {
      lvl, _ := os.LookupEnv(AppLogLevel)
      if lvl != "" {
          return lvl
      }
      return DefLvl
  }
  
  func logLevel(lvl string) logrus.Level {
  
      switch lvl {
      case "debug":
          // Used for tracing
          return logrus.DebugLevel
      case "info":
          return logrus.InfoLevel
      case "error":
          return logrus.ErrorLevel
      case "fatal":
          return logrus.FatalLevel
      default:
          panic(fmt.Sprintf("the specified %s log level is not supported", lvl))
      }
  }
  </code></pre>
  
  <p>I know how to change the log level but I need a way to infuance the logger to change the level</p>