| java.lang.Object org.drools.audit.WorkingMemoryLogger org.drools.audit.WorkingMemoryFileLogger
WorkingMemoryFileLogger | public class WorkingMemoryFileLogger extends WorkingMemoryLogger (Code) | | A logger of events generated by a working memory.
It stores its information in a file that can be specified.
All the events logged are written to the file when the
writeToDisk() method is invoked. The log will contain all
the events logged serialized to XML using XStream.
Every time a new logger is created, the old event log will
be overwritten.
TODO: make this class more scalable, for example
- logging to several files if log becomes too large
- automatically write updates to file at certain time intervals
- ...
author: Kris Verlaenen |
Method Summary | |
public void | clear() Clears all the events in the log. | public void | finalize() | public void | logEventCreated(LogEvent logEvent) | public void | setFileName(String fileName) Sets the name of the file the events are logged in.
No extensions should be given since .log is automatically appended
to the file name.
The default is an event.log file in the current working directory.
This can be a path relative to the current working directory
(e.g. | public void | setMaxEventsInMemory(int maxEventsInMemory) Sets the maximum number of log events that are allowed in memory. | public void | writeToDisk() All events in the log are written to file. |
WorkingMemoryFileLogger | public WorkingMemoryFileLogger(EventManager eventManager)(Code) | | Creates a new WorkingMemoryFileLogger for the given working memory.
Parameters: workingMemory - |
clear | public void clear()(Code) | | Clears all the events in the log.
|
finalize | public void finalize()(Code) | | |
setFileName | public void setFileName(String fileName)(Code) | | Sets the name of the file the events are logged in.
No extensions should be given since .log is automatically appended
to the file name.
The default is an event.log file in the current working directory.
This can be a path relative to the current working directory
(e.g. "mydir/subDir/myLogFile"), or an absolute path
(e.g. "C:/myLogFile").
Parameters: fileName - The name of the file the events should be logged in. |
setMaxEventsInMemory | public void setMaxEventsInMemory(int maxEventsInMemory)(Code) | | Sets the maximum number of log events that are allowed in memory.
If this number is reached, all events are written to file.
The default is 1000.
Parameters: maxEventsInMemory - The maximum number of events in memory. |
writeToDisk | public void writeToDisk()(Code) | | All events in the log are written to file.
The log is automatically cleared afterwards.
|
Methods inherited from org.drools.audit.WorkingMemoryLogger | public void activationCancelled(ActivationCancelledEvent event, WorkingMemory workingMemory)(Code)(Java Doc) public void activationCreated(ActivationCreatedEvent event, WorkingMemory workingMemory)(Code)(Java Doc) public void addFilter(ILogEventFilter filter)(Code)(Java Doc) public void afterActivationFired(AfterActivationFiredEvent event, WorkingMemory workingMemory)(Code)(Java Doc) public void agendaGroupPopped(AgendaGroupPoppedEvent event, WorkingMemory workingMemory)(Code)(Java Doc) public void agendaGroupPushed(AgendaGroupPushedEvent event, WorkingMemory workingMemory)(Code)(Java Doc) public void beforeActivationFired(BeforeActivationFiredEvent event, WorkingMemory workingMemory)(Code)(Java Doc) public void clearFilters()(Code)(Java Doc) abstract public void logEventCreated(LogEvent logEvent)(Code)(Java Doc) public void objectInserted(ObjectInsertedEvent event)(Code)(Java Doc) public void objectRetracted(ObjectRetractedEvent event)(Code)(Java Doc) public void objectUpdated(ObjectUpdatedEvent event)(Code)(Java Doc) public void removeFilter(ILogEventFilter filter)(Code)(Java Doc) public void ruleFlowCompleted(RuleFlowCompletedEvent event, WorkingMemory workingMemory)(Code)(Java Doc) public void ruleFlowGroupActivated(RuleFlowGroupActivatedEvent event, WorkingMemory workingMemory)(Code)(Java Doc) public void ruleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event, WorkingMemory workingMemory)(Code)(Java Doc) public void ruleFlowStarted(RuleFlowStartedEvent event, WorkingMemory workingMemory)(Code)(Java Doc)
|
|
|