-
Language:
English
-
Language:
English
19.2. HelloWorld Example: Event Logging and Auditing
// setup the debug listeners
ksession.addEventListener( new DebugAgendaEventListener() );
ksession.addEventListener( new DebugWorkingMemoryEventListener() );
// setup the audit logging
KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "log/helloworld");- Two default debug listeners are supplied:
DebugAgendaEventListenerandDebugWorkingMemoryEventListener. These print out debug event information to theSystem.errstream displayed in the Console window. - The
KnowledgeRuntimeLoggerprovides execution auditing which can be viewed in a graphical viewer. This logger is a specialised implementation built on the Agenda and Working Memory listeners. - When the engine has finished executing,
logger.close()must be called.