|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.Debug
ecologylab.xml.ElementState
ecologylab.services.logging.Logging<T>
public class Logging<T extends MixedInitiativeOp>
Provides a framework for interaction logging. Uses ecologylab.xml to serialize user and agent actions, and write them either to a file on the user's local machine, or, across the network, to the LoggingServer.
| Nested Class Summary | |
|---|---|
protected class |
Logging.FileLogWriter
LogWriter that uses a local file for logging. |
protected class |
Logging.LogWriter
Objects that process queuedActions for writing, either to a local file, or, using the network, to the LoggingServer. |
protected class |
Logging.MemoryMappedFileLogWriter
LogWriter that uses a memory-mapped local file for logging. |
protected class |
Logging.NetworkLogWriter
LogWriter that connects to the ServicesServer over the network for logging. |
| Nested classes/interfaces inherited from class ecologylab.xml.ElementState |
|---|
ElementState.ClassToCollectionMap, ElementState.DeclarationStyle, ElementState.xml_attribute, ElementState.xml_class, ElementState.xml_classes, ElementState.xml_collection, ElementState.xml_leaf, ElementState.xml_map, ElementState.xml_nested, ElementState.xml_tag |
| Field Summary | |
|---|---|
static java.lang.String |
LOG_CLOSING
Logging closing message string written to the logging file at the end |
static int |
LOG_TO_FILE
Preference setting for logging to a file using normal IO. |
static int |
LOG_TO_FILE_AND_SERVER_REDUNDANT
Preference setting for logging both to a normal IO file and a server. |
static int |
LOG_TO_MEMORY_MAPPED_FILE
Preference setting for logging to a file using memory-mapped IO. |
static int |
LOG_TO_MM_FILE_AND_SERVER_REDUNDANT
Preference setting for logging both to a memory-mapped file and a server. |
static int |
LOG_TO_SERVICES_SERVER
Preference setting for logging to a remote server. |
static java.lang.String |
LOGGING_HOST_PARAM
|
static java.lang.String |
LOGGING_MODE_PARAM
|
static java.lang.String |
LOGGING_PORT_PARAM
|
static int |
NO_LOGGING
Preference setting for no logging. |
protected ArrayListState<T> |
opSequence
This field is used for reading a log in from a file, but not for writing one, because we dont the write the log file all at once, and so can't automatically translate the start tag and end tag for this element. |
| Fields inherited from class ecologylab.xml.ElementState |
|---|
CDATA, ESTIMATE_CHARS_PER_FIELD, FLOATING_PRECISION_OFF, MARSHALLING_PARAMS, NORMAL, UTF16, UTF16_LE, UTF8, XML_FILE_HEADER |
| Fields inherited from interface ecologylab.services.distributed.common.ServicesHostsAndPorts |
|---|
BROWSER_SERVICES_PORT, CF_SERVICES_PORT, CSDLL_HOST, LOGGING_HOST, LOGGING_PORT, PHYSI_ROGUE_UDP_PORT, ROGUE_OSC_SOUND_PATCH_LISTENER_PORT, ROGUE_OSC_SOUND_RECORDER_ACKNOWLEDGE_PORT, ROGUE_PORT, WEB_START_APP_SERVICES_PORT |
| Fields inherited from interface ecologylab.xml.XMLTranslationExceptionTypes |
|---|
FILE_NOT_FOUND, IO_EXCEPTION, NULL_PURL, UNKNOWN |
| Constructor Summary | |
|---|---|
|
Logging()
Constructor for automatic translation from XML |
protected |
Logging(int maxOpsBeforeWrite)
|
|
Logging(java.lang.String logFileName)
Instantiates a Logging object based on the given log file name. |
|
Logging(java.lang.String logFileName,
int maxOpsBeforeWrite)
Instantiates a Logging object based on the given log file name and the maximum operations before write. |
|
Logging(java.lang.String logFileName,
int maxOpsBeforeWrite,
int logMode,
java.lang.String loggingHost,
int loggingPort)
Instantiates a Logging object based on the supplied parameters. |
| Method Summary | |
|---|---|
protected Epilogue |
getEpilogue()
A message at the end of the log. |
ArrayListState<T> |
getOpSequence()
|
Prologue |
getPrologue()
A message at the beginnging of the log. |
void |
logAction(MixedInitiativeOp op)
Translates op to XML then logs it. |
void |
run()
Logging to a file is delayed to the actions of this thread, because otherwise, it can mess up priorities in the system, because events get logged in the highest priority thread. |
static long |
sessionStartTime()
Return our session start timestamp. |
int |
size()
Returns the size of the list of log ops. |
void |
start()
Write the start of the log header out to the log file OR, send the begining logging file message so that logging server write the start of the log header. |
void |
stop()
Finishes writing any queued actions, then sends the epilogue; then shuts down. |
protected void |
writeBufferedOps()
Use the LogWriter, if there is one, to output queued actions to the log. |
| Methods inherited from class ecologylab.generic.Debug |
|---|
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected ArrayListState<T extends MixedInitiativeOp> opSequence
public static final java.lang.String LOG_CLOSING
public static final int NO_LOGGING
public static final int LOG_TO_FILE
public static final int LOG_TO_SERVICES_SERVER
public static final int LOG_TO_MEMORY_MAPPED_FILE
public static final int LOG_TO_MM_FILE_AND_SERVER_REDUNDANT
public static final int LOG_TO_FILE_AND_SERVER_REDUNDANT
public static final java.lang.String LOGGING_HOST_PARAM
public static final java.lang.String LOGGING_PORT_PARAM
public static final java.lang.String LOGGING_MODE_PARAM
| Constructor Detail |
|---|
public Logging(java.lang.String logFileName)
Prefs will handle other settings, indicating how logging will be
performed, and the server setup (if logging over a network).
public Logging(java.lang.String logFileName,
int maxOpsBeforeWrite)
Prefs will handle other
settings, indicating how logging will be performed, and the server setup (if logging over a network).
public Logging(java.lang.String logFileName,
int maxOpsBeforeWrite,
int logMode,
java.lang.String loggingHost,
int loggingPort)
Prefs.
logFileName - the name of the file to which the log will be written.maxOpsBeforeWrite - the maximum number of ops to record in memory before writing them to the set media.logMode - the media to which the logger will write, such as a memory-mapped file or a server.loggingHost - the host to which to log if using networked logging (may be null if local logging is desired).loggingPort - the port of the host to which to log if using networked logging (may be 0 if local logging is desired).public Logging()
protected Logging(int maxOpsBeforeWrite)
| Method Detail |
|---|
public void logAction(MixedInitiativeOp op)
op - -
the operation to be logged.public int size()
public void start()
public void stop()
public void run()
run in interface java.lang.Runnableprotected void writeBufferedOps()
public Prologue getPrologue()
protected Epilogue getEpilogue()
public static final long sessionStartTime()
public ArrayListState<T> getOpSequence()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||