[NO ISSUE][OTH] Use Log4j2 Application Context
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
- Instead of using Log4j2's default LoggerContext, use the
application context to avoid using incorrect configuration
for loggers.
Change-Id: Iea86ddc7a505b8f2c816cc4887a6dc46871ae76d
Reviewed-on: https://asterix-gerrit.ics.uci.edu/3116
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/LoggingConfigUtil.java b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/LoggingConfigUtil.java
index a98c241..cf274af 100644
--- a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/LoggingConfigUtil.java
+++ b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/LoggingConfigUtil.java
@@ -34,7 +34,7 @@
}
public static void defaultIfMissing(String logger, Level defaultLvl) {
- final Configuration loggingConfig = LoggerContext.getContext().getConfiguration();
+ final Configuration loggingConfig = LoggerContext.getContext(false).getConfiguration();
final LoggerConfig loggerConfig = loggingConfig.getLoggers().get(logger);
if (loggerConfig != null) {
LOGGER.info("{} log level is {}", logger, loggerConfig.getLevel());