Skip to content

Commit

Permalink
chore: fix Warn messages (#3776)
Browse files Browse the repository at this point in the history
* chore: using caffeine cache for Spring Cloud LoadBalancer

Signed-off-by: nx673747 <[email protected]>

* chore: hide WARN messages for BeanPostProcessorChecker

Signed-off-by: nx673747 <[email protected]>

* replace deprecated attribute from the logback configuration and hide tls message from CS

Signed-off-by: Andrea Tabone <[email protected]>

* set the instanceInfoReplicationIntervalSeconds to avoid overcoming the limit of request for the demand update

Signed-off-by: Andrea Tabone <[email protected]>

* fix deprecated velocity property

Signed-off-by: Andrea Tabone <[email protected]>

* hide message from SSLUtilBase

Signed-off-by: Andrea Tabone <[email protected]>

* address pr comment

Signed-off-by: Andrea Tabone <[email protected]>

* remove unused variable

Signed-off-by: Andrea Tabone <[email protected]>

---------

Signed-off-by: nx673747 <[email protected]>
Signed-off-by: Andrea Tabone <[email protected]>
Co-authored-by: nx673747 <[email protected]>
Co-authored-by: Andrea Tabone <[email protected]>
  • Loading branch information
3 people authored Sep 18, 2024
1 parent 2513ff1 commit d7dc7ed
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 8 deletions.
2 changes: 2 additions & 0 deletions api-catalog-services/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ dependencies {

implementation libs.apache.velocity

implementation libs.caffeine

implementation(libs.openapidiff) {
exclude group: "io.swagger.core.v3", module: "swagger-core"
// Remove deprecated HTTP client (unused transitive dependency of openDiff)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class SubstituteSwaggerGenerator {
private final VelocityEngine ve = new VelocityEngine();

public SubstituteSwaggerGenerator() {
ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
ve.setProperty(RuntimeConstants.RESOURCE_LOADERS, "classpath");
ve.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
ve.init();
}
Expand Down
3 changes: 3 additions & 0 deletions api-catalog-services/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ logging:
com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient: OFF
com.netflix.discovery.DiscoveryClient: OFF
org.springframework.boot.web.embedded.tomcat.TomcatWebServer: INFO
org.springframework.context.support.[PostProcessorRegistrationDelegate$BeanPostProcessorChecker]: ERROR
org.ehcache: WARN
org.springframework.security.config.annotation.web.builders.WebSecurity: ERROR
org.springframework.security.web: INFO
Expand Down Expand Up @@ -205,8 +206,10 @@ logging:
ROOT: INFO
org.zowe.apiml: DEBUG
org.springframework: INFO
org.springframework.context.support.[PostProcessorRegistrationDelegate$BeanPostProcessorChecker]: DEBUG
org.apache: INFO
org.apache.http: DEBUG
org.apache.tomcat.util.net: DEBUG
com.netflix: INFO
org.ehcache: INFO
com.netflix.discovery.shared.transport.decorator: DEBUG
Expand Down
2 changes: 1 addition & 1 deletion apiml-common/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</turboFilter>
</else>
</if>
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="org.zowe.apiml.product.logging.MaskingLogPatternLayout">
Expand Down
10 changes: 10 additions & 0 deletions caching-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ logging:
com.netflix.discovery.DiscoveryClient: OFF
org.springframework.boot.web.embedded.tomcat.TomcatWebServer: INFO
org.apache.http.conn.ssl.DefaultHostnameVerifier: DEBUG #logs only SSLException
org.apache.tomcat.util.net.SSLUtilBase: ERROR
org.springframework.security.config.annotation.web.builders.WebSecurity: ERROR
javax.net.ssl: ERROR

Expand Down Expand Up @@ -170,6 +171,7 @@ logging:
org.springframework.web.servlet.PageNotFound: WARN
org.ehcache: INFO
com.netflix.discovery.shared.transport.decorator: DEBUG
org.apache.tomcat.util.net: DEBUG
org.springframework.security.web: INFO
javax.net.ssl: INFO

Expand All @@ -194,3 +196,11 @@ eureka:
instance:
nonSecurePortEnabled: true
securePortEnabled: false

---
spring.config.activate.on-profile: debug

logging:
level:
ROOT: INFO
org.apache.tomcat.util.net: DEBUG
2 changes: 1 addition & 1 deletion caching-service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<turboFilter class="org.zowe.apiml.product.logging.ApimlDependencyLogHider"/>
</else>
</if>
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="org.zowe.apiml.product.logging.MaskingLogPatternLayout">
Expand Down
2 changes: 1 addition & 1 deletion discoverable-client/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<turboFilter class="ch.qos.logback.classic.turbo.DuplicateMessageFilter">
<AllowedRepetitions>0</AllowedRepetitions>
</turboFilter>
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS,UTC} %clr(&lt;${logbackService:-${logbackServiceName}}:%thread:${PID:- }&gt;){magenta} %X{userid:-} %clr(%-5level) %clr(\(%logger{15}\)){cyan} %msg%n</pattern>
Expand Down
1 change: 1 addition & 0 deletions discovery-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dependencies {

implementation libs.apache.commons.lang3
implementation libs.jackson.dataformat.yaml
implementation libs.caffeine

testImplementation(testFixtures(project(":apiml-common")))

Expand Down
3 changes: 3 additions & 0 deletions discovery-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ logging:
com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient: OFF
com.netflix.discovery.DiscoveryClient: OFF
org.springframework.boot.web.embedded.tomcat.TomcatWebServer: INFO
org.springframework.context.support.[PostProcessorRegistrationDelegate$BeanPostProcessorChecker]: ERROR
com.sun.jersey.server.impl.application.WebApplicationImpl: WARN
org.ehcache: WARN
org.springframework.security.config.annotation.web.builders.WebSecurity: ERROR
Expand Down Expand Up @@ -160,8 +161,10 @@ logging:
ROOT: DEBUG
org.zowe.apiml: DEBUG
org.springframework: INFO
org.springframework.context.support.[PostProcessorRegistrationDelegate$BeanPostProcessorChecker]: DEBUG
org.apache: INFO
org.apache.http: DEBUG
org.apache.tomcat.util.net: DEBUG
com.netflix: INFO
com.sun.jersey.server.impl.application.WebApplicationImpl: INFO
org.ehcache: INFO
Expand Down
1 change: 1 addition & 0 deletions gateway-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ dependencies {
implementation libs.jjwt.jackson
implementation libs.nimbus.jose.jwt
implementation libs.bcpkix
implementation libs.caffeine

implementation libs.swagger2.parser
implementation libs.swagger3.parser
Expand Down
4 changes: 4 additions & 0 deletions gateway-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ eureka:
client:
fetchRegistry: true
registerWithEureka: true
instanceInfoReplicationIntervalSeconds: 1
region: default
serviceUrl:
defaultZone: ${apiml.service.discoveryServiceUrls}
Expand Down Expand Up @@ -130,9 +131,11 @@ logging:
org.springframework.cloud.gateway.route: WARN
org.springframework.context.support: WARN
org.springframework.beans: WARN
org.springframework.context.support.[PostProcessorRegistrationDelegate$BeanPostProcessorChecker]: ERROR
reactor.netty.http.client: INFO
reactor.netty.http.client.HttpClientConnect: OFF
javax.net.ssl: ERROR
org.apache.tomcat.util.net.SSLUtilBase: ERROR

management:
endpoint:
Expand All @@ -154,6 +157,7 @@ logging:
level:
org.zowe.apiml: DEBUG
org.springframework.cloud.gateway: DEBUG
org.springframework.context.support.[PostProcessorRegistrationDelegate$BeanPostProcessorChecker]: DEBUG
org.springframework.security: DEBUG
org.springframework.web.reactive: DEBUG
org.springframework.web.reactive.socket: DEBUG
Expand Down
2 changes: 1 addition & 1 deletion gateway-service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<turboFilter class="org.zowe.apiml.product.logging.LogLevelInfoFilter"/>
</else>
</if>
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="org.zowe.apiml.product.logging.MaskingLogPatternLayout">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<turboFilter class="ch.qos.logback.classic.turbo.DuplicateMessageFilter">
<AllowedRepetitions>0</AllowedRepetitions>
</turboFilter>
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%cyan(%d{yyyy-MM-dd HH:mm:ss.SSS,UTC}) %gray(&lt;${logbackService:-${logbackServiceName}}:%thread:${PID:- }&gt;){magenta} %X{userid:-} %highlight(%-5level) %magenta(\(%logger{15}\)){cyan} %msg%n</pattern>
Expand Down
2 changes: 2 additions & 0 deletions zaas-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ dependencies {

implementation libs.guava

implementation libs.caffeine

implementation libs.jjwt.impl
implementation libs.jjwt.jackson

Expand Down
3 changes: 3 additions & 0 deletions zaas-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ logging:
org.ehcache: WARN
org.springframework.security.config.annotation.web.builders.WebSecurity: ERROR
org.springframework.cloud.client.loadbalancer.reactive.[ReactorLoadBalancerClientAutoConfiguration$ReactorLoadBalancerClientRibbonWarnLogger]: ERROR
org.springframework.context.support.[PostProcessorRegistrationDelegate$BeanPostProcessorChecker]: ERROR

# New Config
org.apache: WARN #org.apache.catalina, org.apache.coyote, org.apache.tomcat
Expand Down Expand Up @@ -214,8 +215,10 @@ logging:
ROOT: INFO
org.zowe.apiml: DEBUG
org.springframework: INFO
org.springframework.context.support.[PostProcessorRegistrationDelegate$BeanPostProcessorChecker]: DEBUG
org.apache: INFO
org.apache.http: DEBUG
org.apache.tomcat.util.net: DEBUG
com.netflix: DEBUG
org.hibernate: INFO
org.springframework.web.servlet.PageNotFound: WARN
Expand Down
2 changes: 1 addition & 1 deletion zaas-service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<turboFilter class="org.zowe.apiml.product.logging.LogLevelInfoFilter"/>
</else>
</if>
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="org.zowe.apiml.product.logging.MaskingLogPatternLayout">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as fs from "fs";
import * as path from "path";
import {ITestEnvironment, runCliScript, stripProfileDeprecationMessages, TestEnvironment} from "@zowe/cli-test-utils";
import {ITestEnvironment, runCliScript, TestEnvironment} from "@zowe/cli-test-utils";
import {ITestPropertiesSchema} from "../../../__src__/environment/doc/ITestPropertiesSchema";
import {Constants} from "../../../../src/api/Constants";
import {expect, describe, it, beforeAll, afterAll} from '@jest/globals';
Expand Down

0 comments on commit d7dc7ed

Please sign in to comment.