2015-11-30 44 views
4

如何在彈簧引導中禁用下面的調試日誌? 只要對應用程序進行健康檢查請求,就會顯示這些日誌。如何在彈簧引導中禁用jndi調試日誌

我已經嘗試在我們的日誌配置文件中設置記錄器級別以獲取這些軟件包「org.springframework.jndi」和「javax.naming」的信息,但是隻要發生健康檢查請求,上述行仍然會出現。

[DEBUG] jndi - InitialContextFactory.getInitialContext() 
[DEBUG] jndi - Created initial context delegate for local namespace:[email protected] 
[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:[email protected] 
[DEBUG] jndi - Looking up name="endpoints.enabled" 
[DEBUG] jndi - InitialContextFactory.getInitialContext() 
[DEBUG] jndi - Created initial context delegate for local namespace:[email protected] 
[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:[email protected] 
[DEBUG] jndi - Looking up name="endpoints.health.sensitive" 
[DEBUG] jndi - InitialContextFactory.getInitialContext() 
[DEBUG] jndi - Created initial context delegate for local namespace:[email protected] 
[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:[email protected] 
[DEBUG] jndi - Looking up name="endpoints.health.sensitive" 
+0

你解決了這個問題嗎? 這個''不適用於我。 –

回答

0

添加到logback.xml代碼

<logger name="org.eclipse.jetty" level="WARN"/> 
0

從碼頭的源代碼看起來,對於jndi需要日誌記錄級別進行修改:

<logger name="jndi" level="WARN"/>

2

從剔除碼頭,JNDI classpath爲我做了訣竅

<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>