title: How to configure log level for Selenium?
body: <p>I have a project with <code>Selenium</code> and logging with <code>Slf4j</code>. I need set the log level for selenium - <code>INFO</code>. I try use <code>WebDriver.setLogLevel(Level.INFO)</code> but log anyway stay <code>DEBUG</code>.</p>
  
  <pre><code>WebDriver chrome = new ChromeDriver(chromeOptions());
  chrome.setLogLevel(Level.INFO);
  </code></pre>
  
  <p>My <code>logback.xml</code></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
      &lt;appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender"&gt;
  
          &lt;encoder&gt;
              &lt;Pattern&gt;%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg %n
              &lt;/Pattern&gt;
          &lt;/encoder&gt;
          &lt;filter class="ch.qos.logback.classic.filter.ThresholdFilter"&gt;
              &lt;level&gt;TRACE&lt;/level&gt;
          &lt;/filter&gt;
      &lt;/appender&gt;
  
      &lt;appender name="fileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
              &lt;!-- daily rollover --&gt;
              &lt;FileNamePattern&gt;log/log.%d{yyyy-MM-dd}.log&lt;/FileNamePattern&gt;
  
               &lt;!--keep 30 days' worth of history --&gt;
              &lt;maxHistory&gt;30&lt;/maxHistory&gt;
          &lt;/rollingPolicy&gt;
  
          &lt;encoder&gt;
              &lt;Pattern&gt;%d{HH:mm:ss} %-5level %logger{35} - %msg %n&lt;/Pattern&gt;
          &lt;/encoder&gt;
          &lt;maxFileSize&gt;5MB&lt;/maxFileSize&gt;
      &lt;/appender&gt;
  
      &lt;logger name="org.codingpedia" additivity="false" encoding="UTF8"&gt;
          &lt;level value="INFO" /&gt;
          &lt;appender-ref ref="consoleAppender" /&gt;
      &lt;/logger&gt;
  
      &lt;root&gt;
          &lt;level value="DEBUG" encoding="UTF8" /&gt;
          &lt;appender-ref ref="consoleAppender" /&gt;
          &lt;appender-ref ref="fileAppender"/&gt;
      &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>My idea is all <code>Trowable</code> write into a log file, all info about Selenium requests only into the console. But Selenium persistent using <code>DEBUG</code> level.</p>
  
  <p>How to set log level <code>INFO</code> for Selenium. Thank You.</p>
  
  <p><strong>UPDATE 1</strong></p>
  
  <p>I fined (thanks to @Ratmir Asanov) solution, but it requires knowing key for log's <code>DesiredCapabilities</code>.</p>
  
  <pre><code>ChromeOptions options = new ChromeOptions();
  options.setCapability("What key?", getCap());
  
  DesiredCapabilities getCap() {
      DesiredCapabilities caps = DesiredCapabilities.chrome();
      LoggingPreferences logPrefs = new LoggingPreferences();
      logPrefs.enable(LogType.PERFORMANCE, Level.INFO);
      logPrefs.enable(LogType.PROFILER, Level.INFO);
      logPrefs.enable(LogType.BROWSER, Level.INFO);
      logPrefs.enable(LogType.CLIENT, Level.INFO);
      logPrefs.enable(LogType.DRIVER, Level.INFO);
      logPrefs.enable(LogType.SERVER, Level.INFO);
      caps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
      return caps;
  }
  </code></pre>