gpt4 book ai didi

java - 如何安静 Drools 资源扫描仪日志记录?

转载 作者:行者123 更新时间:2023-11-30 04:58:26 26 4
gpt4 key购买 nike

我正在使用 Drool 的资源扫描器,如下所示:

ResourceChangeScannerConfiguration sconf = ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
sconf.setProperty("drools.resource.scanner.interval", "5");
ResourceFactory.getResourceChangeScannerService().configure(sconf);
ResourceFactory.getResourceChangeScannerService().start();
ResourceFactory.getResourceChangeNotifierService().start();

效果很好,但问题是控制台的日志太多:

[2011:10:284 12:10:913:debug] ResourceChangeScanner thread is waiting for 5
[2011:10:284 12:10:915:debug] ResourceChangeScanner attempt to scan 4 resources
[2011:10:284 12:10:915:debug] ResourceChangeScanner scanning directory=[UrlResource path='file:repository/entitlement/static-rules/']
[2011:10:284 12:10:915:debug] ResourceChangeScanner scanning directory=[UrlResource path='file:repository/entitlement/rules/']
[2011:10:284 12:10:915:debug] ResourceChangeScanner thread is waiting for 5
[2011:10:284 12:10:917:debug] ResourceChangeScanner attempt to scan 4 resources
[2011:10:284 12:10:917:debug] ResourceChangeScanner scanning directory=[UrlResource path='file:repository/entitlement/static-rules/']
[2011:10:284 12:10:917:debug] ResourceChangeScanner scanning directory=[UrlResource p

每 5 秒出现一组新行。知道如何让它安静一点吗?

最佳答案

这应该可以做到:

ResourceFactory.getResourceChangeNotifierService().
setSystemEventListener(new DoNothingSystemEventListener());

顺便说一句,这是默认监听器,不知道为什么 org.drools.agent.impl.PrintStreamSystemEventListener在您的案例中被选中。

关于java - 如何安静 Drools 资源扫描仪日志记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7729399/

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