Search code examples
optaplanner

Stop output from drools when starting OptaPlanner from a JAR


How to stop the drools logger when executing OptaPlanner from a compiled JAR?

In the logback.xml file the drools output is commented out and when i run the project directly from Eclipse everything is ok the only output is the one from OptaPlanner (either debug or trace) , but when i compile everything into a JAR and run it from the JAR for some reason i also get the drools output.


Solution

  • I solved this with turning off the Drools logger through the Java API.

    Logger droolsLogger = (Logger) LoggerFactory.getLogger("org.drools");
    droolsLogger.setLevel(Level.OFF);