Skip to content

Commit 17061eb

Browse files
committed
remove Spring starting logs
1 parent 0e87cbf commit 17061eb

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

web/service/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ COPY ${JAR_FILES} /
2727
ADD ./newrelic/newrelic.jar /newrelic/newrelic.jar
2828

2929
ENV SPRING_PROFILES_ACTIVE=cloud
30+
ENV SPRING_MAIN_BANNER-MODE=off
3031
ENV SENTRY_LOGGING_MINIMUM_EVENT_LEVEL=error
3132
ENV SENTRY_LOGGING_MINIMUM_BREADCRUMB_LEVEL=info
3233

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package org.mobilitydata.gtfsvalidator.web.service.util;
2+
3+
import java.util.logging.LogManager;
4+
import java.util.logging.Logger;
5+
import javax.annotation.PostConstruct;
6+
import org.slf4j.bridge.SLF4JBridgeHandler;
7+
import org.springframework.context.annotation.Configuration;
8+
9+
@Configuration
10+
public class LoggingBridgeConfig {
11+
12+
@PostConstruct
13+
public void setupJulToSlf4jBridge() {
14+
// Reset JUL root logger and install SLF4J bridge
15+
LogManager.getLogManager().reset();
16+
SLF4JBridgeHandler.removeHandlersForRootLogger();
17+
SLF4JBridgeHandler.install();
18+
19+
Logger rootLogger = Logger.getLogger("");
20+
}
21+
}

web/service/src/main/resources/logback-spring.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<logger name="org.apache.catalina" level="WARN" />
3535
<logger name="org.apache.coyote" level="WARN" />
3636
<logger name="org.apache.tomcat" level="WARN" />
37-
<logger name="org.springframework.web" level="WARN" />
37+
<logger name="org.springframework.web" level="WARN" additivity="false" />
3838
<logger name="com.google.cloud.spring.core" level="WARN" />
3939
<logger name="com.google.cloud.spring.autoconfigure" level="WARN" />
4040

0 commit comments

Comments
 (0)