log4j has no logging, but setup according to documentation
by Tom Eugelink
I'm still pretty new to drools (5.4.0 final) and I would like to see what Drools does; rules validation, MVEL expression evaluation, etc.
There is a webpage that says that in order to activate logging I need to add a line to my log4j.xml:
/http://docs.jboss.org/drools/release/5.4.0.Final/drools-planner-docs/html_single/index.html#d0e2947
/
First remark is that the XML is old style log4j; the current XML uses loggers and levels instead of category and priority. Beside that, it does not seem to work. After I've added /<logger name="org.drools"><level value="debug" /></logger>/ to my xml, nothing is logged. I know for sure that log4j via slf4j is working:
/log4j: Trying to find [log4j.xml] using context classloader sun.misc.Launcher$AppClassLoader@1c672d0.
log4j: Using URL [file:/C:/Documents%20and%20Settings/User/My%20Documents/frozn/components/engine/_build/log4j.xml] for automatic log4j configuration.
...
2012-08-02 10:55:04,400 INFO nl.o837.frozn.engine.drools.test.DroolsExcelTrial.main(DroolsExcelTrial.java:49) running trail
...
/
However there is no Drools logging output on the console, only the print statements I've placed in the entity models. If I add this line to the code:
/KnowledgeRuntimeLoggerFactory.newConsoleLogger(sessionObject);/
Then there is some logging output:
/OBJECT ASSERTED value:nl.o837.frozn.bm.Application@f664ec&ApplicationId=1 factId: 1
ACTIVATION CREATED rule:PassportValidation_20 activationId:PassportValidation_20 [2] declarations: p=nl.o837.frozn.bm.Passport@5e29e5&PassportId=2(2)
OBJECT ASSERTED value:nl.o837.frozn.bm.Passport@5e29e5&PassportId=2 factId: 2
BEFORE ACTIVATION FIRED rule:PassportValidation_20 activationId:PassportValidation_20 [2] declarations: p=nl.o837.frozn.bm.Passport@5e29e5&PassportId=2(2)
/
So Drools actually is producing logging information.
Is the documentation on the webpage incorrect? How do I get the logging information I would like?
Tom
12 years, 4 months
fire a rule only once (for the time being)
by slyfox
It seems like there are many similar problems but I have not been able to
find anything that addresses my issue exactly.
I have a stock trading application, and I want to check if the price is out
of a range (high,low)
if the price goes below low, the problem is the rule keeps firing if the
price keeps going lower, this creates too much noise and overhead.
I thought maybe the no-loop and duration attributes would help but they
didnt.
I know I could check not(Fired()) and use insert fired but I believe that
spans the entire session which I do not want either.
Is there a way to say fire this rule if true once then wait a period of time
before I check again.
>From what Ive read maybe agenda filters, but I am not sure if that is
flexible enough.
--
View this message in context: http://drools.46999.n3.nabble.com/fire-a-rule-only-once-for-the-time-bein...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months