What you need to do is implement your own SystemEventListener implementation to override the default one.  Before you do anything meaningful with Drools, you’ll want to override the default by calling:

   SystemEventListenerFactory.setSystemEventListener(<YOUR SystemEventListenerImpl>);

 

Here’s a basic no-op listener:

            new SystemEventListener () {

 

                  public void debug(String arg0) { }

                  public void debug(String arg0, Object arg1) {}

                  public void exception(Throwable arg0) {}

                  public void exception(String arg0, Throwable arg1) {}

                  public void info(String arg0) {}

                  public void info(String arg0, Object arg1) {}

                  public void warning(String arg0) {}

                  public void warning(String arg0, Object arg1) {}

                 

            };

 

In reality what you probably want to do is hook in your application’s logger here so it will respect the same log levels the rest of your application runs under.

 

Macon

 

 


From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Steve Ronderos
Sent: Wednesday, September 30, 2009 12:53 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] (no subject)

 


Hello Drools Users,

I've been looking into why Drools 5 is logging debug and info messages to System.out in my app and trying to figure out how to make it stop.  It looks like the SystemEventListener that the SystemEventListenerFactory returns is a DelegatingSystemEventListener that delegates to a PrintStreamSystemEventListener.  This, by default, uses System.out as the print stream target.  I looked into the Factory and it looks like I can provide a different SystemEventListener or SystemEventListenerProvider, but it also mentions that it did not find anything in the properties, so it fails over to the default SystemEventListenerProvider.  Is there a way to configure a custom SystemEventListener or SystemEventListenerProvider so that you don't have to call SystemEventListenerFactory.setSystemEventListenerProvider() at startup?

Thanks,

Steve Ronderos