2016-03-09 123 views
0

我有一個web應用程序部署在tomcat服務器上。 我使用log4j進行日誌記錄。它運作良好。 但問題是,當有什麼發生,log4j的連續寫入以下日誌文​​件:Log4j不斷寫入日誌文件,即使沒有什麼可寫的東西?

[DEBUG] 2016-03-09 09:13:46,617 com.mchange.v2.async.ThreadPoolAsynchronousRunner - com[email protected]1f3e145e -- Running DeadlockDetector[Exiting. No pending tasks.] 
[DEBUG] 2016-03-09 09:13:56,620 com.mchange.v2.async.ThreadPoolAsynchronousRunner - com[email protected]1f3e145e -- Running DeadlockDetector[Exiting. No pending tasks.] 
[DEBUG] 2016-03-09 09:14:06,623 com.mchange.v2.async.ThreadPoolAsynchronousRunner - com[email protected]1f3e145e -- Running DeadlockDetector[Exiting. No pending tasks.] 
[DEBUG] 2016-03-09 09:14:16,626 com.mchange.v2.async.ThreadPoolAsynchronousRunner - com[email protected]1f3e145e -- Running DeadlockDetector[Exiting. No pending tasks.] 
[DEBUG] 2016-03-09 09:14:26,629 com.mchange.v2.async.ThreadPoolAsynchronousRunner - com[email protected]1f3e145e -- Running DeadlockDetector[Exiting. No pending tasks.] 
[DEBUG] 2016-03-09 09:14:36,632 com.mchange.v2.async.ThreadPoolAsynchronousRunner - com[email protected]1f3e145e -- Running DeadlockDetector[Exiting. No pending tasks.] 
[DEBUG] 2016-03-09 09:14:46,635 com.mchange.v2.async.ThreadPoolAsynchronousRunner - com[email protected]1f3e145e -- Running DeadlockDetector[Exiting. No pending tasks.] 
[DEBUG] 2016-03-09 09:14:56,638 com.mchange.v2.async.ThreadPoolAsynchronousRunner - com[email protected]1f3e145e -- Running DeadlockDetector[Exiting. No pending tasks.] 
[DEBUG] 2016-03-09 09:15:06,641 com.mchange.v2.async.ThreadPoolAsynchronousRunner - com[email protected]1f3e145e -- Running DeadlockDetector[Exiting. No pending tasks.] 
[DEBUG] 2016-03-09 09:15:16,644 com.mchange.v2.async.ThreadPoolAsynchronousRunner - com[email protected]1f3e145e -- Running DeadlockDetector[Exiting. No pending tasks.] 
[DEBUG] 2016-03-09 09:15:26,647 com.mchange.v2.async.ThreadPoolAsynchronousRunner - com[email protected]1f3e145e -- Running DeadlockDetector[Exiting. No pending tasks.] 

我不想在日誌文件中的這些消息。

有沒有解決方案?

回答

0

除了上面的消息,log4j還寫了一些其他的消息,以及什麼都沒有發生。所以日誌文件越來越大,看起來很尷尬。 我將閾值從DEBUG更改爲INFO。 它解決了我的問題,我的日誌現在看起來很乾淨。