log4j-Konfiguration

Will ich meine config logging-system basiert auf slf4j und log4j. Ich möchte, um alle Nachrichten zu protokollieren, von com.Der A-Klasse. Und nur diese Nachrichten.

also schrieb ich in meine config-Datei

log4j.rootLogger=FATAL, Alle 
log4j.rootLogger=DEBUG, A1 
log4j.appender.A1=com.Ein 
log4j.appender.Konsole=org.apache.log4j.ConsoleAppender 
log4j.appender.Console.layout=org.apache.log4j.PatternLayout 
log4j.appender.Console.layout.conversionPattern=%m%n 

Mein runner (com.Start-Klasse) enthält

PropertyConfigurator.configure("log4j.properties");

Aber wenn ich die Anwendung starten bekomme ich

log4j:ERROR A "com.A" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [sun.misc.Launcher$AppClassLoader@d9f9c3] whereas object of type 
log4j:ERROR "com.A" was loaded by [sun.misc.Launcher$AppClassLoader@d9f9c3].
log4j:ERROR Could not instantiate appender named "A1".
log4j:WARN No appenders could be found for logger (com.Start).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Wo ist mein Fehler?

Dank.

InformationsquelleAutor Stan Kurilin | 2010-11-18
Schreibe einen Kommentar