Martin Peřina has uploaded a new change for review. Change subject: tools: Replace log4j with JUL backend in tests ......................................................................
tools: Replace log4j with JUL backend in tests Replaces log4j with java.util.logging backend in tools tests. Change-Id: Iea7e88ba482dfa31472286067581adaab5830c8c Bug-Url: https://bugzilla.redhat.com/1109871 Signed-off-by: Martin Perina <[email protected]> --- M backend/manager/tools/pom.xml D backend/manager/tools/src/test/resources/log4j.xml A backend/manager/tools/src/test/resources/logging.properties 3 files changed, 23 insertions(+), 22 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/34185/1 diff --git a/backend/manager/tools/pom.xml b/backend/manager/tools/pom.xml index 2171ed0..d1950b2 100644 --- a/backend/manager/tools/pom.xml +++ b/backend/manager/tools/pom.xml @@ -60,6 +60,13 @@ <scope>test</scope> </dependency> + <!-- JUL is used as logging backend for tests --> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + <scope>test</scope> + </dependency> + </dependencies> <build> @@ -67,6 +74,9 @@ <plugin> <artifactId>maven-surefire-plugin</artifactId> <configuration> + <systemPropertyVariables> + <java.util.logging.config.file>src/test/resources/logging.properties</java.util.logging.config.file> + </systemPropertyVariables> <additionalClasspathElements> <additionalClasspathElement>${basedir}/**/src/test/java</additionalClasspathElement> </additionalClasspathElements> diff --git a/backend/manager/tools/src/test/resources/log4j.xml b/backend/manager/tools/src/test/resources/log4j.xml deleted file mode 100644 index 549acfd..0000000 --- a/backend/manager/tools/src/test/resources/log4j.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> - -<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false"> - - <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> - <!-- errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> --> - <param name="Target" value="System.out"/> - <layout class="org.apache.log4j.PatternLayout"> - <!-- The default pattern: Date Priority [Category] Message\n --> - </layout> - </appender> - - <category name="org.apache.commons.configuration.ConfigurationUtils"> - <priority value="ERROR"/> - </category> - - <root> - <priority value="DEBUG"/> - <appender-ref ref="CONSOLE"/> - </root> - -</log4j:configuration> diff --git a/backend/manager/tools/src/test/resources/logging.properties b/backend/manager/tools/src/test/resources/logging.properties new file mode 100644 index 0000000..ece92d3 --- /dev/null +++ b/backend/manager/tools/src/test/resources/logging.properties @@ -0,0 +1,13 @@ +# Default format of log line is: DATE TIME LEVEL [SOURCE] Message Stacktrace +java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS,%1$tL %4$-7s [%2$s] %5$s%6$s%n + +# Default logging level +.level=FINE + +# Root handlers +handlers=java.util.logging.ConsoleHandler + +java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + +# Set appropriate log level per category +org.apache.commons.configuration.ConfigurationUtils.level=SEVERE -- To view, visit http://gerrit.ovirt.org/34185 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iea7e88ba482dfa31472286067581adaab5830c8c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Peřina <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
