This is an automated email from the ASF dual-hosted git repository. dhemery pushed a commit to branch support/1.12 in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/support/1.12 by this push: new 6ffbab0 GEODE-7851: Add slf4j implementation to Pulse (#4992) 6ffbab0 is described below commit 6ffbab0d484811baa009b5bb72896b9f42cce21f Author: Dale Emery <dem...@pivotal.io> AuthorDate: Fri Apr 24 16:42:34 2020 -0700 GEODE-7851: Add slf4j implementation to Pulse (#4992) Pulse was not logging because its war file had no slf4j implementation. This commit adds the log4j2 implementation to the war file. Authored-by: Dale Emery <dem...@pivotal.io> --- .../apache/geode/tools/pulse/PulseLoggingTest.java | 44 ++++++++++++++++++++++ geode-pulse/build.gradle | 4 +- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseLoggingTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseLoggingTest.java new file mode 100644 index 0000000..a7a8c56 --- /dev/null +++ b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseLoggingTest.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.apache.geode.tools.pulse; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.nio.file.Path; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import org.apache.geode.test.junit.categories.PulseTest; +import org.apache.geode.test.junit.categories.SecurityTest; +import org.apache.geode.test.junit.rules.LocatorStarterRule; + +@Category({SecurityTest.class, PulseTest.class}) +public class PulseLoggingTest { + @Rule + public LocatorStarterRule locator = new LocatorStarterRule() + .withHttpService() + .withJMXManager() + .withAutoStart(); + + @Test + public void pulseCreatesLogFileOnStartup() { + Path locatorDir = locator.getWorkingDir().toPath(); + Path pulseLogFile = locatorDir.resolve("pulse.log"); + assertThat(pulseLogFile).exists(); + } +} diff --git a/geode-pulse/build.gradle b/geode-pulse/build.gradle index 2909cd7..9d60078 100644 --- a/geode-pulse/build.gradle +++ b/geode-pulse/build.gradle @@ -52,7 +52,6 @@ dependencies { // Needed to fully use log4j instead of commons-logging. compile('org.apache.logging.log4j:log4j-jcl') compile('org.apache.logging.log4j:log4j-api') -// compile('org.apache.logging.log4j:log4j-core') compile('commons-beanutils:commons-beanutils') compile('commons-collections:commons-collections') @@ -91,8 +90,7 @@ dependencies { runtimeOnly('org.springframework:spring-expression') - // added only to ensure common version with other geode modules - runtimeOnly('org.slf4j:slf4j-api') + runtimeOnly('org.apache.logging.log4j:log4j-slf4j-impl') providedCompile('commons-logging:commons-logging')