[rules-users] Drools Memory Log getting over written
Geoffrey De Smet
ge0ffrey.spam at gmail.com
Thu Sep 13 01:52:18 EDT 2012
In Drools 5.5.0.Beta1, we 'll have Logback, Log4J, JDKLogger, ...
support through SLF4J:
https://hudson.jboss.org/hudson/view/Drools%20jBPM/job/drools/lastSuccessfulBuild/artifact/drools-docs/drools-expert-docs/target/docbook/publish/en-US/html_single/index.html#d0e2310
But to use it, you 'll have to combine it with
WorkingMemoryConsoleLogger instead I believe.
Using Logback it's fairly easy to set the rules on appending to the log,
rolling the log, zipping the old logs, ...
http://logback.qos.ch/manual/appenders.html => section FileAppender
Op 12-09-12 14:35, himansu.nayak schreef:
> Hi,
> i am trying to append my memory log generated by drools rule engine. but
> each time
> i run the code the log just get overwritten. is there any way to avoid
> overwritten of my log.
> this is the code i am using for my log generation.
>
> type 1
> ---------
> WorkingMemory workingMemory = ruleBase.newStatefulSession();
> WorkingMemoryFileLogger wmLogger = new WorkingMemoryFileLogger(
> workingMemory);
> wmLogger.setFileName("log/xyz");
> .
> .
> .
> wmLogger.writeToDisk();
>
> type 2
> ---------
> KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory
> .newFileLogger(ksession,
> log/xyz.log);
> ksession.addEventListener(CustomAgendaEventListener.getInstance());
> ksession.addEventListener(CustomWorkingMemoryEventListener
> .getInstance());
> .
> .
> .
> .
> logger.close();
>
>
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Drools-Memory-Log-getting-over-written-tp4019703.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
More information about the rules-users
mailing list