title: How to make java.util.logging send logs to Logback?
body: <p>I'm working on an app that logs using the slf4j api:</p>
  
  <pre><code>import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  ...
  
  private static final Logger LOG = LoggerFactory.getLogger(FreemarkerEmailPreviewGenerator.class);
  
  ...
  
  LOG.error("Error generating email preview", e);
  </code></pre>
  
  <p>(Code above posted to show classes and packages in use, but pretty standard stuff.)</p>
  
  <p>We use logback configured as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
  
      &lt;appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;[%d{HH:mm:ss.SSS}] [%thread] [%-5level %logger{26} - %msg]%n
              &lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;root&gt;
          &lt;level value="debug" /&gt;
          &lt;appender-ref ref="STDOUT" /&gt;
      &lt;/root&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Some of our code makes use of 3rd party libraries that logs with java.util.logging - specifically freemarker. As you can see from the following console log entries, both logback and j.u.l are logging to the console, but they are not using the same config (the logback entries use our pattern, the j.u.l ones don't)</p>
  
  <pre><code>[12:24:38.842] [pool-2-thread-19] [INFO  u.o.n.r.l.s.e.t.TemplateLoaderFromService - Finding template workflow/mail/templates/common/workflow-macros.ftl]
  [12:24:38.859] [pool-2-thread-19] [INFO  u.o.n.r.l.s.e.t.TemplateLoaderFromService - Loaded template workflow/mail/templates/common/workflow-macros.ftl as /workflow/mail/templates/common/workflow-macros.ftl from RegistryMailTemplateService.]
  11-Jan-2017 12:24:38 freemarker.log.JDK14LoggerFactory$JDK14Logger error
  SEVERE:
  
  Expression domainContact is undefined on line 9, column 74 in workflow/mail/templates/common/workflow-macros.ftl.
  The problematic instruction:
  ----------
  ==&gt; ${domainContact.name} [on line 9, column 72 in workflow/mail/templates/common/workflow-macros.ftl]
  </code></pre>
  
  <p>Is it possible to make j.u.l logging use the logback config so that we have a single consistent logging config for the whole app?</p>