diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java index 4f6a38f1b081..4bc46ef2c435 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java +++ b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java @@ -19,6 +19,7 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.UnsynchronizedAppenderBase; +import ch.qos.logback.core.util.Loader; import com.google.cloud.MonitoredResource; import com.google.cloud.logging.LogEntry; import com.google.cloud.logging.Logging; @@ -143,7 +144,7 @@ private LoggingEnhancer getEnhancer(String enhancerClassName) { try { Class clz = (Class) - ClassLoader.getSystemClassLoader().loadClass(enhancerClassName.trim()); + Loader.loadClass(enhancerClassName.trim()); return clz.newInstance(); } catch (Exception ex) { // If we cannot create the enhancer we fallback to null