[ASTERIXDB-1564][CONF] Replace Remaining Usage of JUL
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
- Replace remaining usage of java.util.logging
by Log4j2.
Change-Id: I894348b09a862693ae31de7c2f4768877a5297db
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2254
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
diff --git a/hyracks-fullstack/hyracks/hyracks-test-support/pom.xml b/hyracks-fullstack/hyracks/hyracks-test-support/pom.xml
index 6559308..fde7394 100644
--- a/hyracks-fullstack/hyracks/hyracks-test-support/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-test-support/pom.xml
@@ -108,5 +108,9 @@
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ </dependency>
</dependencies>
</project>
diff --git a/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/common/AbstractIndexLifecycleTest.java b/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/common/AbstractIndexLifecycleTest.java
index 8fc4275..ddb5717 100644
--- a/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/common/AbstractIndexLifecycleTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/common/AbstractIndexLifecycleTest.java
@@ -18,16 +18,13 @@
*/
package org.apache.hyracks.storage.am.common;
-import java.nio.file.NoSuchFileException;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.util.IoUtil;
import org.apache.hyracks.storage.common.IIndex;
-import org.apache.hyracks.util.RuntimeLogsMonitor;
+import org.apache.hyracks.util.Log4j2Monitor;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.core.config.Configurator;
import org.junit.After;
-import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
@@ -49,12 +46,8 @@
@BeforeClass
public static void startLogsMonitor() {
- RuntimeLogsMonitor.monitor("org.apache.hyracks");
- }
-
- @AfterClass
- public static void afterClass() {
- RuntimeLogsMonitor.stop();
+ Configurator.setLevel("org.apache.hyracks", Level.INFO);
+ Log4j2Monitor.start();
}
@Before
@@ -65,7 +58,7 @@
@Test
public void validSequenceTest() throws Exception {
- RuntimeLogsMonitor.reset();
+ Log4j2Monitor.reset();
// Double create is invalid
index.create();
Assert.assertTrue(persistentStateExists());
@@ -104,8 +97,7 @@
index.destroy();
Assert.assertFalse(persistentStateExists());
index.destroy();
- final LogRecord fileNotFoundWarnLog = new LogRecord(Level.WARNING, IoUtil.FILE_NOT_FOUND_MSG);
- Assert.assertTrue(RuntimeLogsMonitor.count(fileNotFoundWarnLog) > 0);
+ Assert.assertTrue(Log4j2Monitor.count(IoUtil.FILE_NOT_FOUND_MSG) > 0);
Assert.assertFalse(persistentStateExists());
}