Update integration test base classes to use Log4J2
[controller.git] / opendaylight / config / config-it-base / src / main / java / org / opendaylight / controller / config / it / base / AbstractConfigTestBase.java
index 4d964ee..549aef7 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.controller.config.it.base;
 
+import static org.ops4j.pax.exam.CoreOptions.composite;
 import static org.ops4j.pax.exam.CoreOptions.maven;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.when;
@@ -110,8 +111,13 @@ public abstract class AbstractConfigTestBase {
     public abstract String getFeatureName();
 
     public Option getLoggingOption() {
-        return editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG, logConfiguration(AbstractConfigTestBase.class),
-                LogLevel.INFO.name());
+        Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
+                "log4j2.logger.config-it-base.name",
+                AbstractConfigTestBase.class.getPackage().getName());
+        option = composite(option, editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
+                "log4j2.logger.config-it-base.level",
+                LogLevel.INFO.name()));
+        return option;
     }
 
     /**
@@ -123,10 +129,6 @@ public abstract class AbstractConfigTestBase {
         return null;
     }
 
-    public String logConfiguration(final Class<?> klazz) {
-        return "log4j.logger." + klazz.getPackage().getName();
-    }
-
     public String getKarafDistro() {
         String groupId = System.getProperty(KARAF_DISTRO_GROUPID_PROP, KARAF_DISTRO_GROUPID);
         String artifactId = System.getProperty(KARAF_DISTRO_ARTIFACTID_PROP, KARAF_DISTRO_ARTIFACTID);
@@ -168,7 +170,7 @@ public abstract class AbstractConfigTestBase {
                 features(getFeatureRepo(), getFeatureName()),
                 mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.api", "1.0.0"), getLoggingOption(),
                 mvnLocalRepoOption(),
-                editConfigurationFilePut(ETC_ORG_OPS4J_PAX_LOGGING_CFG, "log4j.rootLogger", "INFO, stdout, osgi:*") };
+                editConfigurationFilePut(ETC_ORG_OPS4J_PAX_LOGGING_CFG, "log4j2.rootLogger.level", "INFO") };
         return OptionUtils.combine(options, getAdditionalOptions());
     }
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.