geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kirk Lund <kl...@pivotal.io>
Subject Fix for ClassCastException when using Logback for 1.10.0
Date Thu, 08 Aug 2019 18:24:51 GMT
This is the last logging related fix that I'd like to propose adding to
1.10.0
release branch.

Spring Boot adds Logback and log4j-to-slf4j to the classpath. This
results in ClassCastExceptions if log4j-core is not excluded.

This change prevents Geode from using Log4jAgent if Log4j Core is
present but not using Log4jProvider.

For example, Log4j uses SLF4JProvider instead of Log4jProvider when
log4j-to-slf4j is in the classpath.

By disabling Log4jAgent when other Log4j Providers are in use, this
prevents problems such as ClassCastExceptions when attempting to cast
loggers from org.apache.logging.slf4j.SLF4JLogger to
org.apache.logging.log4j.core.Logger to get the LoggerConfig or
LoggerContext.

PR: https://github.com/apache/geode/pull/3892
GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider
https://issues.apache.org/jira/browse/GEODE-7050

Thanks,
Kirk and Aaron

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message