Using Apache’s HTTP client implementation in Java I’ve been seeing this:
log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager). log4j:WARN Please initialize the log4j system properly.
The sensible fix appears to be:
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Jdk14Logger");
(As all J2SE versions since 2002 (!) have had a workable logger built in; this would seem like a more sensible default. If it was a developer’s desire to benefit not merely from the standardised API but also from the common implementation then, presumably, using Log4J directly would be what they’d do…)
Also useful to remove unnecessary chatter:
Logger.getAnonymousLogger().getParent().setLevel(Level.WARNING);