title: How to send java.util.logging to log4j?
body: <p>I have an existing application which does all of its logging against log4j. We use a number of other libraries that either also use log4j, or log against Commons Logging, which ends up using log4j under the covers in our environment. One of our dependencies even logs against slf4j, which also works fine since it eventually delegates to log4j as well.</p>
  
  <p>Now, I'd like to add ehcache to this application for some caching needs. Previous versions of ehcache used commons-logging, which would have worked perfectly in this scenario, but as of <a href="http://ehcache.sourceforge.net/changes-report.html#1.6.0-beta1" rel="noreferrer">version 1.6-beta1</a> they have removed the dependency on commons-logging and replaced it with java.util.logging instead.</p>
  
  <p>Not really being familiar with the built-in JDK logging available with java.util.logging, is there an easy way to have any log messages sent to JUL logged against log4j, so I can use my existing configuration and set up for any logging coming from ehcache?</p>
  
  <p>Looking at the javadocs for JUL, it looks like I could set up a bunch of environment variables to change which <code>LogManager</code> implementation is used, and perhaps use that to wrap log4j <code>Logger</code>s in the JUL <code>Logger</code> class. Is this the correct approach?</p>
  
  <p>Kind of ironic that a library's use of built-in JDK logging would cause such a headache when (most of) the rest of the world is using 3rd party libraries instead.</p>