Repository: provectus/kafka-ui
Issue: Log warnings after upgrading from version 0.6.2 to 0.7.0
Labels: good first issue
scope/backend
type/chore

### Issue submitter TODO list

- [X] I've looked up my issue in [FAQ](https://docs.kafka-ui.provectus.io/faq/common-problems)
- [X] I've searched for an already existing issues [here](https://github.com/provectus/kafka-ui/issues)
- [X] I've tried running `master`-labeled docker image and the issue still persists there
- [X] I'm running a supported version of the application which is listed [here](https://github.com/provectus/kafka-ui/blob/master/SECURITY.md)

### Describe the bug (actual behavior)

I use 'persistent' version of KafkaUI without Docker and provide all parameters as Env-vars in my shell-script.
After upgrading from version 0.6.2 to 0.7.0 I see in the KafkaUI log-file messages 'Could NOT find resource [logback.xml]'.
I also see messages about the absence of some parameters for starting KafkaUI, although I have them set:
2023-05-15 11:13:13,619 INFO  [main] c.p.k.u.KafkaUiApplication: No active profile set, falling back to 1 default profile: "default"
2023-05-15 11:13:16,761 DEBUG [main] c.p.k.u.s.SerdesInitializer: Configuring serdes for cluster KAFKATS_TEST
2023-05-15 11:13:17,380 INFO  [main] o.s.b.a.e.w.EndpointLinksResolver: Exposing 2 endpoint(s) beneath base path '/actuator'
2023-05-15 11:13:17,420 INFO  [main] o.s.s.l.u.DefaultLdapAuthoritiesPopulator: Will not perform group search since groupSearchBase is null.
2023-05-15 11:13:17,562 INFO  [main] c.p.k.u.c.a.LdapSecurityConfig: Configuring LDAP authentication.
2023-05-15 11:13:17,659 INFO  [main] o.s.l.c.s.AbstractContextSource: Property 'userDn' not set - anonymous context will be used for read-write operations
2



### Expected behavior

The provided warnings are absent

### Your installation details

KafkaUI - [fdd9ad9](https://github.com/provectus/kafka-ui/commit/fdd9ad9) 11.05.2023, 17:02:15
KafkaUI startup script with configuration parameters:
export DYNAMIC_CONFIG_ENABLED='false'
export SECURITY_BASIC_ENABLED='false'

export SERVER_PORT='8080'
export SERVER_SSL_ENABLED='true'
export SERVER_SSL_KEY_STORE_TYPE='JKS'
export SERVER_SSL_KEY_STORE='/disk01/kafka-ui-api-v0.7.0/keystore.jks'
export SERVER_SSL_KEY_STORE_PASSWORD='***'

export AUTH_TYPE='LDAP'
export SPRING_LDAP_URLS='ldaps://****.**.*.com:3269 ldaps://****.**.*.com:3269'
export SPRING_LDAP_BASE='DC=\**,DC=\*,DC=com'
export SPRING_LDAP_USER_FILTER_SEARCH_BASE='DC=\**,DC=\*,DC=com'
export SPRING_LDAP_USER_FILTER_SEARCH_FILTER='(&(sAMAccountName={0})(|(memberOf=CN=kafka-admin,OU=Service,DC=**,DC=*,DC=com)(memberOf=CN=admin,OU=Service,DC=\**,DC=\*,DC=com)))'
export SPRING_LDAP_ADMIN_USER='CN=ldap-user,OU=Service,DC=\**,DC=\*,DC=com'
export SPRING_LDAP_ADMIN_PASSWORD='***'

export KAFKA_CLUSTERS_0_METRICS_PORT='9094'
export KAFKA_CLUSTERS_0_METRICS_SSL='false'
export KAFKA_CLUSTERS_0_METRICS_TYPE='false'

export KAFKA_CLUSTERS_0_NAME='KAFKATS_TEST'
export KAFKA_CLUSTERS_0_READONLY='false'
export KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS='kafka-tst.**.*.com:9093'
export KAFKA_CLUSTERS_0_ZOOKEEPER='kafka-tst.**.*.com:2182'

export KAFKA_CLUSTERS_0_SSL_TRUSTSTORELOCATION='/disk01/kafka-ui-api-v0.7.0/keystore.jks'
export KAFKA_CLUSTERS_0_SSL_TRUSTSTOREPASSWORD='***'

export KAFKA_CLUSTERS_0_PROPERTIES_SECURITY_PROTOCOL='SASL_SSL'
export KAFKA_CLUSTERS_0_PROPERTIES_SASL_MECHANISM='GSSAPI'
export KAFKA_CLUSTERS_0_PROPERTIES_SASL_KERBEROS_SERVICE_NAME='kafkats'
export KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG='com.sun.security.auth.module.Krb5LoginModule required serviceName="kafkats" useKeyTab=true storeKey=true keyTab="/disk01/kafka-ui-api-v0.7.0/kafka-tst.keytab" principal="kafkats/kafka-tst.**.*.com@**.*.COM";'
export KAFKA_CLUSTERS_0_PROPERTIES_SSL_KEYSTORE_TYPE='JKS'
export KAFKA_CLUSTERS_0_PROPERTIES_SSL_KEYSTORE_LOCATION='/disk01/kafka-ui-api-v0.7.0/keystore.jks'
export KAFKA_CLUSTERS_0_PROPERTIES_SSL_KEYSTORE_PASSWORD='***'
export KAFKA_CLUSTERS_0_PROPERTIES_SSL_KEY_PASSWORD='***'
export KAFKA_CLUSTERS_0_PROPERTIES_SSL_TRUSTSTORE_TYPE='JKS'
export KAFKA_CLUSTERS_0_PROPERTIES_SSL_TRUSTSTORE_LOCATION='/disk01/kafka-ui-api-v0.7.0/keystore.jks'
export KAFKA_CLUSTERS_0_PROPERTIES_SSL_TRUSTSTORE_PASSWORD='***'
export KAFKA_CLUSTERS_0_PROPERTIES_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM=''

export KAFKA_CLUSTERS_0_SCHEMAREGISTRY='https://kafka-tst.**.*.com:8081'
export KAFKA_CLUSTERS_0_SCHEMAREGISTRYSSL_KEYSTORELOCATION='/disk01/kafka-ui-api-v0.7.0/keystore.jks'
export KAFKA_CLUSTERS_0_SCHEMAREGISTRYSSL_KEYSTOREPASSWORD='***'
export KAFKA_CLUSTERS_0_SCHEMAREGISTRYSSL_KEYPASSWORD='***'
export KAFKA_CLUSTERS_0_SCHEMAREGISTRYSSL_TRUSTSTORELOCATION='/disk01/kafka-ui-api-v0.7.0/keystore.jks'
export KAFKA_CLUSTERS_0_SCHEMAREGISTRYSSL_TRUSTSTOREPASSWORD='***'

export JAVA_OPTS=" -Dzookeeper.client.secure=false -Dzookeeper.ssl.client.enable=false -Djavax.net.ssl.keyStoreType=jks -Djavax.net.ssl.keyStore=/disk01/kafka-ui-api-v0.7.0/keystore.jks -Djavax.net.ssl.keyStorePassword=*** -Djavax.net.ssl.trustStoreType=jks -Djavax.net.ssl.trustStore=/disk01/kafka-ui-api-v0.7.0/keystore.jks -Djavax.net.ssl.trustStorePassword==***"
export JAVA_OPTS="$JAVA_OPTS -Xms2g -Xmx4g -Djava.awt.headless=true --add-opens java.rmi/javax.rmi.ssl=ALL-UNNAMED"

cd /disk01/kafka-ui-api-v0.7.0
nohup /opt/java/jdk-17.0.3.1/bin/java $JAVA_OPTS -jar /disk01/kafka-ui-api-v0.7.0/kafka-ui-api-v0.7.0.jar>/disk01/kafka-ui-api-v0.7.0/kafkaui-console.log 2>&1 &



### Steps to reproduce

Start KafkaUI without dokcer with similar startup parameters as my

### Screenshots

![image](https://github.com/provectus/kafka-ui/assets/117813220/07e48221-23e6-404d-bc50-3ff672e7c89d)


### Logs

11:13:12,650 |-INFO in ch.qos.logback.classic.LoggerContext[default] - This is logback-classic version 1.4.6
11:13:12,684 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
11:13:12,685 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml]
11:13:12,693 |-INFO in ch.qos.logback.classic.BasicConfigurator@1ffe63b9 - Setting up default configuration.
11:13:13,307 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@51e5fc98 - URL [jar:file:/disk01/kafka-ui-api-v0.7.0/kafka-ui-api-v0.7.0.jar!/BOOT-INF/classes!/logback-spring.xml] is not of type file
11:13:13,420 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [STDOUT]
11:13:13,421 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
11:13:13,458 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This appender no longer admits a layout as a sub-component, set an encoder instead.
11:13:13,458 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
11:13:13,458 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
11:13:13,458 |-INFO in ch.qos.logback.classic.model.processor.RootLoggerModelHandler - Setting level of ROOT logger to INFO
11:13:13,458 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@7c469c48 - Propagating INFO level on Logger[ROOT] onto the JUL framework
11:13:13,459 |-INFO in ch.qos.logback.core.model.processor.AppenderRefModelHandler - Attaching appender named [STDOUT] to Logger[ROOT]
11:13:13,459 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor@12e61fe6 - End of configuration.
11:13:13,459 |-INFO in org.springframework.boot.logging.logback.SpringBootJoranConfigurator@7ee955a8 - Registering current configuration as safe fallback point

 _   _ ___    __             _                _          _  __      __ _
| | | |_ _|  / _|___ _ _    /_\  _ __ __ _ __| |_  ___  | |/ /__ _ / _| |_____
| |_| || |  |  _/ _ | '_|  / _ \| '_ / _` / _| ' \/ -_) | ' </ _` |  _| / / _`|
 \___/|___| |_| \___|_|   /_/ \_| .__\__,_\__|_||_\___| |_|\_\__,_|_| |_\_\__,|
                                 |_|

2023-05-15 11:13:13,542 INFO  [background-preinit] o.h.v.i.u.Version: HV000001: Hibernate Validator 8.0.0.Final
2023-05-15 11:13:13,618 INFO  [main] c.p.k.u.KafkaUiApplication: Starting KafkaUiApplication using Java 17.0.3.1 with PID 148550 (/disk01/kafka-ui-api-v0.7.0/kafka-ui-api-v0.7.0.jar started by root in /disk01/kafka-ui-api-v0.7.0)
2023-05-15 11:13:13,618 DEBUG [main] c.p.k.u.KafkaUiApplication: Running with Spring Boot v3.0.5, Spring v6.0.7
2023-05-15 11:13:13,619 INFO  [main] c.p.k.u.KafkaUiApplication: No active profile set, falling back to 1 default profile: "default"
2023-05-15 11:13:16,761 DEBUG [main] c.p.k.u.s.SerdesInitializer: Configuring serdes for cluster KAFKATS_TEST
2023-05-15 11:13:17,380 INFO  [main] o.s.b.a.e.w.EndpointLinksResolver: Exposing 2 endpoint(s) beneath base path '/actuator'
2023-05-15 11:13:17,420 INFO  [main] o.s.s.l.u.DefaultLdapAuthoritiesPopulator: Will not perform group search since groupSearchBase is null.
2023-05-15 11:13:17,562 INFO  [main] c.p.k.u.c.a.LdapSecurityConfig: Configuring LDAP authentication.
2023-05-15 11:13:17,659 INFO  [main] o.s.l.c.s.AbstractContextSource: Property 'userDn' not set - anonymous context will be used for read-write operations
2023-05-15 11:13:17,948 INFO  [main] o.s.b.w.e.n.NettyWebServer: Netty started on port 8080
2023-05-15 11:13:17,966 INFO  [main] c.p.k.u.KafkaUiApplication: Started KafkaUiApplication in 5.086 seconds (process running for 5.766)
2023-05-15 11:13:20,012 DEBUG [parallel-3] c.p.k.u.s.ClustersStatisticsScheduler: Start getting metrics for kafkaCluster: KAFKATS_TEST


### Additional context

_No response_

Issue comments:
The only thing worth paying attention here is this:

```
11:13:13,458 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This appender no longer admits a layout as a sub-component, set an encoder instead.
11:13:13,458 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
```

@iliax guess we might need to update the appender within logback's xml? Might be related to spring version bump.

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-api/src/main/resources/application.yml b/kafka-ui-api/src/main/resources/application.yml
index 864289c2d9a..71af4e8d925 100644
--- a/kafka-ui-api/src/main/resources/application.yml
+++ b/kafka-ui-api/src/main/resources/application.yml
@@ -17,4 +17,5 @@ logging:
     root: INFO
     com.provectus: DEBUG
     reactor.netty.http.server.AccessLog: INFO
+    org.hibernate.validator: WARN
 
diff --git a/kafka-ui-api/src/main/resources/logback-spring.xml b/kafka-ui-api/src/main/resources/logback-spring.xml
index a0705128172..a33692146bb 100644
--- a/kafka-ui-api/src/main/resources/logback-spring.xml
+++ b/kafka-ui-api/src/main/resources/logback-spring.xml
@@ -1,17 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
 
-        <appender name="STDOUT"
-              class="ch.qos.logback.core.ConsoleAppender">
-        <layout class="ch.qos.logback.classic.PatternLayout">
-            <Pattern>
-                %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%c{1}): %msg%n%throwable
-            </Pattern>
-        </layout>
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%c{1}): %msg%n%throwable</pattern>
+        </encoder>
     </appender>
 
     <root level="info">
-        <appender-ref ref="STDOUT" />
+        <appender-ref ref="STDOUT"/>
     </root>
 
 </configuration>


Test patch: