ich diese Störung erhalte, wenn die Anlegesteg-Maven-Plugin ausgeführt wird:SLF4J/Log4J nicht in Anlegesteg-Maven-Plugin initialisiert
[INFO] --- jetty-maven-plugin:7.6.1.v20120215:start (start-jetty) @ rest ---
log4j:WARN No appenders could be found for logger (org.eclipse.jetty.util.log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Das Projekt ist ein Krieg, der log4j.properties in WEB-INF/classes
enthält.
Ich bin auch in den folgenden Eigenschaften zum Plugin vorbei, nur um zu sehen, was vor sich geht (das insbesondere log4j.properties Datei vorhanden ist in der Lage sowohl unterhalb als auch):
<!-- Log4J settings -->
<systemProperty>
<name>log4j.configuration</name>
<value>file://${project.build.testOutputDirectory}/log4j.properties</value>
</systemProperty>
<systemProperty>
<name>log4j.debug</name>
</systemProperty>
Die Protokollierung in der Webapp funktioniert gut. Ich bin jedoch von dem Fehler verblüfft.
Ich habe diese Abhängigkeiten im Projekt:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-core</artifactId>
</dependency>
Zusätzlich wird, wenn die Tests (die Anlegestelle müssen) laufen beginnen, muss ich die folgende Ausgabe sehen:
log4j: Using URL [file:/project/foo/rest/target/test-classes/log4j.properties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/project/foo/rest/target/test-classes/log4j.properties
log4j: Parsing for [root] with value=[ERROR, console].
log4j: Level token is [ERROR].
log4j: Category root set to ERROR
log4j: Parsing appender named "console".
log4j: Parsing layout options for "console".
log4j: Setting property [conversionPattern] to [%d %p %c - %m%n].
log4j: End of parsing for "console".
log4j: Parsed "console" options.
log4j: Parsing for [project.foo] with value=[DEBUG].
log4j: Level token is [DEBUG].
log4j: Category project.foo set to DEBUG
log4j: Handling log4j.additivity.project.foo=[null]
log4j: Finished configuring.
Könnte jemand sagen ich, warum Jetty ist unglücklich?
Vielen Dank für diese Lösung; Ihr Plugin funktionierte nicht für mich, aber ich konnte das Set-System-Properties-Ziel des Properties Maven-Plugins (http://mojo.codehaus.org/properties-maven-plugin) verwenden, um dasselbe zu erreichen. – piepera
Ich habe tatsächlich einen Bug für die Jetty Jungs hier eingereicht: https://jira.codehaus.org/browse/JETTY-1507. Grundsätzlich wird das Plugin keine Systemeigenschaft überschreiben, die bereits existiert. Ich musste das auf die harte Tour finden. Es ist wirklich kein erwartetes Verhalten. Wenn Sie möchten, können Sie für das Ticket abstimmen. – carlspring