gpt4 book ai didi

tomcat - 即使没有什么可写的,Log4j 也会继续写入日志文件?

转载 作者:行者123 更新时间:2023-11-28 23:26:53 24 4
gpt4 key购买 nike

我在 tomcat 服务器上部署了一个 Web 应用程序。我使用 log4j 进行日志记录。它运作良好。但问题是当什么都没有发生时,log4j 会不断将以下内容写入日志文件:

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

我不希望这些消息出现在日志文件中。

有什么解决办法吗?

最佳答案

除了上面的消息之外,log4j 在没有任何事情发生的时候也在写一些其他的消息。所以日志文件越来越大,看起来很尴尬。我将阈值从 DEBUG 更改为 INFO。它解决了我的问题,我的日志现在看起来很干净。

关于tomcat - 即使没有什么可写的,Log4j 也会继续写入日志文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35895618/

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