gpt4 book ai didi

spring-boot - 如何在 Spring Boot 中禁用 jndi 调试日志

转载 作者:行者123 更新时间:2023-12-03 07:02:55 26 4
gpt4 key购买 nike

如何在 Spring Boot 中禁用以下调试日志?每当向应用程序发出运行状况检查请求时,就会出现这些日志。

我尝试在日志配置文件中将记录器级别设置为这些包“org.springframework.jndi”和“javax.naming”的信息,但每当发出运行状况检查请求时,上述行仍然会出现。

[DEBUG] jndi - InitialContextFactory.getInitialContext()
[DEBUG] jndi - Created initial context delegate for local namespace:org.eclipse.jetty.jndi.local.localContextRoot@756a5bed
[DEBUG] jndi - Looking up name="comp/env/endpoints.enabled"
[DEBUG] jndi - Trying thread context classloader
[DEBUG] jndi - Looking up name="env/endpoints.enabled"
[DEBUG] jndi - InitialContextFactory.getInitialContext()
[DEBUG] jndi - Created initial context delegate for local namespace:org.eclipse.jetty.jndi.local.localContextRoot@6a85ff9f
[DEBUG] jndi - Looking up name="endpoints.enabled"
[DEBUG] jndi - InitialContextFactory.getInitialContext()
[DEBUG] jndi - Created initial context delegate for local namespace:org.eclipse.jetty.jndi.local.localContextRoot@293101e3
[DEBUG] jndi - Looking up name="comp/env/endpoints.health.sensitive"
[DEBUG] jndi - Trying thread context classloader
[DEBUG] jndi - Looking up name="env/endpoints.health.sensitive"
[DEBUG] jndi - InitialContextFactory.getInitialContext()
[DEBUG] jndi - Created initial context delegate for local namespace:org.eclipse.jetty.jndi.local.localContextRoot@235a3b05
[DEBUG] jndi - Looking up name="endpoints.health.sensitive"
[DEBUG] jndi - InitialContextFactory.getInitialContext()
[DEBUG] jndi - Created initial context delegate for local namespace:org.eclipse.jetty.jndi.local.localContextRoot@439cc794
[DEBUG] jndi - Looking up name="comp/env/endpoints.health.sensitive"
[DEBUG] jndi - Trying thread context classloader
[DEBUG] jndi - Looking up name="env/endpoints.health.sensitive"
[DEBUG] jndi - InitialContextFactory.getInitialContext()
[DEBUG] jndi - Created initial context delegate for local namespace:org.eclipse.jetty.jndi.local.localContextRoot@221fa466
[DEBUG] jndi - Looking up name="endpoints.health.sensitive"

最佳答案

从类路径中排除 jetty-jndi 对我来说很有效

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<!-- see https://github.com/spring-projects/spring-boot/issues/4710 -->
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jndi</artifactId>
</exclusion>
</exclusions>
</dependency>

关于spring-boot - 如何在 Spring Boot 中禁用 jndi 调试日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33991626/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com