diff --git a/uat/custom-components/pom.xml b/uat/custom-components/pom.xml index 26f64c46..d4443f4e 100644 --- a/uat/custom-components/pom.xml +++ b/uat/custom-components/pom.xml @@ -66,12 +66,12 @@ ch.qos.logback logback-classic - 1.3.0-alpha4 + 1.3.13 ch.qos.logback logback-core - 1.3.12 + 1.3.13 org.junit.jupiter diff --git a/uat/custom-components/src/main/java/com/aws/greengrass/artifacts/LogGenerator.java b/uat/custom-components/src/main/java/com/aws/greengrass/artifacts/LogGenerator.java index 20690101..cc28f291 100644 --- a/uat/custom-components/src/main/java/com/aws/greengrass/artifacts/LogGenerator.java +++ b/uat/custom-components/src/main/java/com/aws/greengrass/artifacts/LogGenerator.java @@ -13,6 +13,7 @@ import ch.qos.logback.core.rolling.RollingFileAppender; import ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy; import ch.qos.logback.core.util.FileSize; +import org.slf4j.helpers.NOPMDCAdapter; import software.amazon.awssdk.aws.greengrass.model.InvalidArgumentsError; import java.util.concurrent.TimeUnit; @@ -67,6 +68,8 @@ private void generateLogs() throws InterruptedException { private Logger configureLogger() { LoggerContext loggerContext = new LoggerContext(); + // Must set an MDC adapter for 1.3.8+. https://github.com/qos-ch/logback/issues/709 + loggerContext.setMDCAdapter(new NOPMDCAdapter()); Logger logger = loggerContext.getLogger("LogGenerator"); // appender: output destination