im not sure i understand.
the line:
KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newConsoleLogger(droolsSession);
is the only line i have regarding a logger. if its commented or not i still
get logs written to the stdout.
how can i disable this?
Thanks.
Nadav.
On Sun, Nov 28, 2010 at 4:13 PM, Greg Barton <greg_barton(a)yahoo.com> wrote:
You're just commenting out the references to the loggere, but not
the
construction. (if the line breaks are the same in your original code as they
are below.)
GreG
On Nov 28, 2010, at 6:54, Nadav Hashimshony <nadavh(a)gmail.com> wrote:
> my drools application write debug and info message to the console.
>
> i currently do the follwoing
>
> in the main thread i i have:
>
> private static KnowledgeBase m_droolsKbase= createKnowledgeBase();
>
> private static KnowledgeBase createKnowledgeBase()
> {
> ResourceFactory.getResourceChangeNotifierService().start();
> ResourceFactory.getResourceChangeScannerService().start();
>
>
> Properties droolsConf = new Properties();
> droolsConf.setProperty("drools.dialect.java.compiler",
"JANINO");
> KnowledgeBuilderConfiguration config =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(droolsConf, null);
> KnowledgeBuilder builder =
KnowledgeBuilderFactory.newKnowledgeBuilder(config);
>
builder.add(ResourceFactory.newFileResource(m_properties.getProperty("drools.pkg")),
ResourceType.PKG);
>
> if (builder.hasErrors())
> {
> throw new
RuntimeException(builder.getErrors().toString());
> }
>
> KnowledgeBase knowledgeBase =
KnowledgeBaseFactory.newKnowledgeBase();
>
knowledgeBase.addKnowledgePackages(builder.getKnowledgePackages());
>
> m_droolsKagent=
KnowledgeAgentFactory.newKnowledgeAgent("DroolsAgent",knowledgeBase);
>
m_droolsKagent.applyChangeSet(ResourceFactory.newFileResource(m_properties.getProperty("drools.pkg.xml")));
> return m_droolsKagent.getKnowledgeBase();
> }
>
>
> each worker thread does the following:
>
> StatefulKnowledgeSession droolsSession =
m_droolsKagent.getKnowledgeBase().newStatefulKnowledgeSession();
> //KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newConsoleLogger(droolsSession);
> //KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newFileLogger(droolsSession,
"var/log/ctch/ctDefender/ctDefenderDrools.log");
> .
> .
> .
>
>
> Even if the logger lines are commented i still get log prints to console
(STDOUT)
>
> how can i control them? stop them?
>
> Thanks.
> Nadav.
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users