How to quietly log the Drools Asset Scanner?

I am using the Drool Resource Scanner as follows:

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

      

Which works well, but the problem is that there are too many logs on the console:

[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

      

Every 5 seconds a new set of lines. Any idea to calm him down a bit?

+1


source to share


1 answer


This should do it:

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

      



By the way, this is the default listener, not sure why it org.drools.agent.impl.PrintStreamSystemEventListener

gets picked up in your case.

+2


source







All Articles