Permalink
Browse files

Updating OSGi logging.

  • Loading branch information...
Fabrice Bacchella
Fabrice Bacchella committed Nov 5, 2018
1 parent 8d3546e commit 5461418d8a4b7d79f5b11bb7a077befed6bab480
Showing with 45 additions and 22 deletions.
  1. +28 −7 pom.xml
  2. +4 −4 src/test/java/org/rrd4j/osgi/OSGiSmokeTest.java
  3. +13 −0 src/test/resources/log4j2.xml
  4. +0 −11 src/test/resources/logback-test.xml
35 pom.xml
@@ -22,12 +22,13 @@
<maven.plugin.resources.version>2.7</maven.plugin.resources.version>
<maven.plugin.surefire.version>2.19.1</maven.plugin.surefire.version>
<junit.version>4.12</junit.version>
<log4j>2.11.0</log4j>
<pax-exam.version>4.11.0</pax-exam.version>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<jdk.home>${java.home}</jdk.home>
<!-- current year. -->
<year>2018</year>
<pax-exam.version>4.11.0</pax-exam.version>
</properties>
<licenses>
<license>
@@ -88,18 +89,30 @@
<version>${pax-exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<version>6.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
@@ -294,6 +307,14 @@
<name>java.awt.headless</name>
<value>true</value>
</property>
<property>
<name>log4j2.debug</name>
<value>false</value>
</property>
<property>
<name>maven.loglevel</name>
<value>off</value>
</property>
</systemProperties>
</configuration>
</plugin>
@@ -38,7 +38,7 @@
*/
@RunWith(PaxExam.class)
public class OSGiSmokeTest {
@Rule
public TemporaryFolder temp = new TemporaryFolder();
@@ -49,7 +49,7 @@
@Test
public void basicUsage() throws IOException {
// OSGi metadata is only added for Java8+, so skip this test on Java 7
String javaVersion = System.getProperty("java.version");
assumeThat(javaVersion, not(startsWith((("1.7")))));
@@ -59,9 +59,9 @@ public void basicUsage() throws IOException {
rrdDef.addArchive(AVERAGE, 0.5, 6, 700); // 6 steps, 700 rows
rrdDef.addDatasource("inbytes", DsType.GAUGE, 600, Double.NaN, Double.NaN);
rrdDef.addArchive(MAX, 0.5, 1, 600);
Random rnd = new Random();
// due to sun.misc usually not being exported, default to the FILE backend
try (RrdDb rrdDb = new RrdDb(rrdDef, RrdBackendFactory.getFactory("FILE"))) {
long time = System.currentTimeMillis() / 1000;
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="error">
<Appenders>
<Console name="TestConsole" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
</Console>
</Appenders>
<Loggers>
<Root level="${sys:maven.loglevel:-debug}">
<AppenderRef ref="TestConsole" />
</Root>
</Loggers>
</Configuration>

This file was deleted.

Oops, something went wrong.

0 comments on commit 5461418

Please sign in to comment.