title: Logback ClassCastException for LoggerFactory
body: <p>I am using below code to change log level at runtime in logback.</p>
  
  <pre><code>import org.slf4j.LoggerFactory;
  import ch.qos.logback.classic.Level;
  import ch.qos.logback.classic.Logger;
  
  Logger root = (Logger)LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
  </code></pre>
  
  <p>However I am getting ClassCastException with message:</p>
  
  <pre><code>org.slf4j.helpers.NOPLogger cannot be cast to ch.qos.logback.classic.Logger
  </code></pre>
  
  <p>My pom has these dependencies:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
      &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
      &lt;version&gt;1.0.13&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
      &lt;artifactId&gt;logback-core&lt;/artifactId&gt;
      &lt;version&gt;1.0.13&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
      &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
      &lt;version&gt;1.7.5&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>I am not able to figure out whats wrong here. I can see many examples using this code. But its not working for me. I want to change log level dynamically so I am using Logger class from classic instead of slf4j. Can anybody help me identifying where I am wrong?</p>