|
Drools :: Core 6.1.0.Beta1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.drools.core.audit.WorkingMemoryLogger
org.drools.core.audit.WorkingMemoryFileLogger
public class WorkingMemoryFileLogger
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 - ...
| Field Summary | |
|---|---|
protected static org.slf4j.Logger |
logger
|
protected boolean |
terminate
|
| Fields inherited from class org.drools.core.audit.WorkingMemoryLogger |
|---|
isPhreak |
| Constructor Summary | |
|---|---|
WorkingMemoryFileLogger()
|
|
WorkingMemoryFileLogger(org.kie.internal.event.KnowledgeRuntimeEventManager session)
|
|
WorkingMemoryFileLogger(WorkingMemory workingMemory)
Creates a new WorkingMemoryFileLogger for the given working memory. |
|
| Method Summary | |
|---|---|
void |
logEventCreated(LogEvent logEvent)
This method is invoked every time a new log event is created. |
void |
readExternal(ObjectInput in)
|
void |
setFileName(String fileName)
Sets the name of the file the events are logged in. |
void |
setMaxEventsInMemory(int maxEventsInMemory)
Sets the maximum number of log events that are allowed in memory. |
void |
setSplit(boolean split)
|
void |
stop()
|
void |
writeExternal(ObjectOutput out)
|
void |
writeToDisk()
All events in the log are written to file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static transient org.slf4j.Logger logger
protected boolean terminate
| Constructor Detail |
|---|
public WorkingMemoryFileLogger()
public WorkingMemoryFileLogger(WorkingMemory workingMemory)
public WorkingMemoryFileLogger(org.kie.internal.event.KnowledgeRuntimeEventManager session)
| Method Detail |
|---|
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class WorkingMemoryLoggerIOException
ClassNotFoundException
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizablewriteExternal in class WorkingMemoryLoggerIOExceptionpublic void setFileName(String fileName)
fileName - The name of the file the events should be logged in.public void writeToDisk()
public void setMaxEventsInMemory(int maxEventsInMemory)
maxEventsInMemory - The maximum number of events in memory.public void logEventCreated(LogEvent logEvent)
WorkingMemoryLogger
logEventCreated in class WorkingMemoryLoggerpublic void setSplit(boolean split)
public void stop()
|
Drools :: Core 6.1.0.Beta1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||