Skip to content

Commit 7e9dca8

Browse files
committed
Fixup spring-geode-starter-logging tests based on Spring Boot 2.7 logging (SLF4J, Logback) configuration.
1 parent 5939463 commit 7e9dca8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

spring-geode-starter-logging/src/test/java/org/springframework/geode/logging/slf4j/logback/AbstractLoggingIntegrationTests.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
* @see ch.qos.logback.classic.Logger
6060
* @see ch.qos.logback.classic.LoggerContext
6161
* @see ch.qos.logback.classic.util.ContextInitializer
62+
* @see ch.qos.logback.core.Appender
6263
* @since 1.3.0
6364
*/
6465
@SuppressWarnings("unused")
@@ -73,8 +74,10 @@ public abstract class AbstractLoggingIntegrationTests {
7374
ch.qos.logback.classic.Logger::getLevel;
7475

7576
protected static final String APACHE_GEODE_LOGGER_NAME = "org.apache.geode";
76-
protected static final String CONSOLE_APPENDER_NAME = "CONSOLE";
77+
protected static final String CONSOLE_APPENDER_NAME = "console";
7778
protected static final String DELEGATE_APPENDER_NAME = "delegate";
79+
protected static final String GEMSTONE_GEMFIRE_LOGGER_NAME = "com.gemstone.gemfire";
80+
protected static final String JGROUPS_LOGGER_NAME = "org.jgroups";
7881
protected static final String SPRING_BOOT_DATA_GEMFIRE_LOG_LEVEL_PROPERTY = "spring.boot.data.gemfire.log.level";
7982

8083
private static TestAppender testAppender;
@@ -179,15 +182,17 @@ private static void configureLogging(Level testLogLevel) {
179182
.getStatusManager().add(LoggingStatusListener.create().debug(STATUS_DEBUG_ENABLED));
180183

181184
logConfiguredLoggers(loggerContext);
182-
assertLogbackLoggerConfiguration(loggerContext,
183-
Logger.ROOT_LOGGER_NAME, APACHE_GEODE_LOGGER_NAME, "com.gemstone.gemfire", "org.jgroups");
185+
assertLogbackLoggerConfiguration(loggerContext,Logger.ROOT_LOGGER_NAME,
186+
APACHE_GEODE_LOGGER_NAME, GEMSTONE_GEMFIRE_LOGGER_NAME, JGROUPS_LOGGER_NAME);
187+
188+
ch.qos.logback.classic.Logger logbackRootLogger = assertLogbackLogger(loggerContext
189+
.getLogger(Logger.ROOT_LOGGER_NAME), Logger.ROOT_LOGGER_NAME, Level.ERROR);
184190

185191
ch.qos.logback.classic.Logger logbackOrgApacheGeodeLogger = assertLogbackLogger(loggerContext
186192
.getLogger(APACHE_GEODE_LOGGER_NAME), APACHE_GEODE_LOGGER_NAME, testLogLevel);
187193

188-
logConfiguredAppenders(logbackOrgApacheGeodeLogger);
189-
assertLogbackLoggerAppenderConfiguration(logbackOrgApacheGeodeLogger,
190-
CONSOLE_APPENDER_NAME, DELEGATE_APPENDER_NAME);
194+
logConfiguredAppenders(logbackRootLogger);
195+
assertLogbackLoggerAppenderConfiguration(logbackRootLogger, DELEGATE_APPENDER_NAME);
191196
}
192197
catch (Exception cause) {
193198
throw newIllegalStateException("Failed to configure and initialize SLF4J/Logback", cause);

0 commit comments

Comments
 (0)