title: How to change the logging level in an included library?
body: <p>In this case I'm using the <code>oshi</code> sysinfo library, and spring boot too.</p>
  <p>I tried using a log4j2.xml file with the <code>com.github.oshi</code> logger set to <code>INFO</code> but it did not work in turning off the following <code>DEBUG</code>-level messages.</p>
  <pre><code>...
  04:33:57.687 [Thread-3] DEBUG oshi.util.FileUtil - Reading file /sys/devices/system/cpu/cpu10/cpufreq/scaling_cur_freq
  04:33:57.687 [Thread-3] DEBUG oshi.util.FileUtil - Reading file /sys/devices/system/cpu/cpu10/cpufreq/scaling_cur_freq
  /sys/devices/system/cpu/cpu13/cpufreq/scaling_cur_freq
  04:33:57.707 [Thread-3] DEBUG oshi.util.FileUtil - Reading file 
  ...
  </code></pre>
  <p><a href="https://github.com/oshi/oshi" rel="nofollow noreferrer">https://github.com/oshi/oshi</a></p>
  <p>The following setting in log4j2.xml did not work:</p>
  <pre><code>  &lt;category name=&quot;oshi&quot;&gt;
      &lt;priority value=&quot;OFF&quot;/&gt;
    &lt;/category&gt;
  
    &lt;Loggers&gt;
      &lt;!-- avoid duplicated logs with additivity=false --&gt;
      &lt;Logger name=&quot;oshi&quot; level=&quot;info&quot; additivity=&quot;false&quot;&gt;
        &lt;AppenderRef ref=&quot;LogToRollingFile&quot;/&gt;
      &lt;/Logger&gt;
      &lt;Root level=&quot;info&quot;&gt;
        &lt;AppenderRef ref=&quot;LogToConsole&quot;/&gt;
      &lt;/Root&gt;
    &lt;/Loggers&gt;
  </code></pre>
  <p><code>pom.xml</code> contains:</p>
  <pre><code>...
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
        &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
        &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
        &lt;artifactId&gt;log4j-slf4j-impl&lt;/artifactId&gt;
      &lt;/dependency&gt;
  ...
  
  </code></pre>