1

I am using Drool's resource scanner like so:

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 is logs to the console way too much:

[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 how to quiet it down a bit?

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
Shane C. Mason
  • 7,518
  • 3
  • 26
  • 33

1 Answers1

2

This should do it:

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

BTW this is the default listener, don't know why org.drools.agent.impl.PrintStreamSystemEventListener is picked up in your case.

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674