log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.BasicClientConnectionManager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See Apache log4j 1.2 - Frequently Asked Technical Questions for more info.
wenig hilfreich ist jedenfalls, mit komischen pom-Dateien zu hantieren, aber das Grundhandwerk nicht zu kennen
deine geposteten Warnungen enthalten eine FAQ, mit gar nicht so üblen Hinweisen
Why do I see a warning about „No appenders found for logger“ and „Please configure log4j properly“?
This occurs when the default configuration files log4j.properties and log4j.xml can not be found and the application performs no explicit configuration. log4j uses Thread.getContextClassLoader().getResource() to locate the default configuration files and does not directly check the file system. Knowing the appropriate location to place log4j.properties or log4j.xml requires understanding the search strategy of the class loader in use. log4j does not provide a default configuration since output to the console or to the file system may be prohibited in some environments. Also see FAQ: Why can't log4j find my properties in a J2EE or WAR application?.
wo hast du denn die Datei log4j.properties abgelegt, und wie wo wann wird welche Art Projekt/ Java-Programm gestartet?
{
public static void main(String[] args)
{
Log logger = LogFactory.getLog(Dummy1.class);
logger.error("abc");
URL url = Thread.currentThread().getContextClassLoader().getResource("log4j.properties");
System.out.println("url: " + url);
File f = new File(url.getFile());
System.out.println("f: " + f.exists());
}
}```
mit deiner log4j.properties im src-Verzeichnis wie im Eclipse-Projekt konfiguriert liefert bei mir unter Eclipse.Ausführung
> 2015-08-05 10:26:38 ERROR Dummy1:14 - abc
> url: file:/C:/[Pfad zum Projekt]/target/classes/log4j.properties
> f: true
die properties-Datei im Grundverzeichnis des Projekts würde dagegen zwar einen hier relativ einfachen File-Zugriff ermöglichen:
``` File f2 = new File("log4j.properties"); // relativ zum Ausführungsverzeichnis des Programmes
System.out.println("f2: " + f2.exists()); // gefunden
File f3 = new File(".");
System.out.println("f3: " + f3.getAbsolutePath()); // zeigt das Ausführungsverzeichnis an```
aber wieder die Warnungen, von Log4J nicht gefunden
standardmäßig gibt es glaube ich ein src-Unterverzeichnis für Java-Sourcen, Projekt genauer anschauen falls es in diese Richtung geht,
mit Jar/ Web-Programmen ganz andere Fragen