Log files
The log files will be in the format outlined by the logfile.xsd schema file. All log files submitted will need to validate against this format to be accepted. You can test your logfile by copying the XSD schema to your home directory and running the following command on the ELW B203 machines:
xmllint --schema logfile.xsd --noout yourlogfile.xml
Note: if you are running this command on a home computer, make sure you're using a version of xmllint which is 20624 or higher (xmllint --version).
If your logfile does not match the standard format, this will print out errors explaining what is missing in your file. Some notes:
- Only log a quoteServer event when you actually hit the quote server; if you are caching stock quotes and you have a cache hit, that can be logged as a systemEvent
- Any field defined as minOccurs="0" is optional eg. the DUMPLOG command requires a filename, but not a stock symbol
- Money should be logged to the cent. Even if the last digit(s) of the number are zeros, they must appear in your log file.
- All times must be in the standard Unix timestamp format in milliseconds
- The available user commands are all explained here
- The server field is the name you have given to the server which produced that output
- Any other restrictions can be found in logfile.xsd and you can contact the TA with any questions about XML validation
Example User Command Set:
ADD, jiosesdo, 100.00
BUY, jiosesdo, ABC, 100.00
BUY, skelsioe, DEF, 1000.00
SELL, bob, GHI, 1000.00
Associated Sample Log File Entries:
<?xml version="1.0"?>
<log>
<userCommand>
<timestamp>1167631200000</timestamp>
<server>CLT1</server>
<transactionNum>1</transactionNum>
<command>ADD</command>
<username>jiosesdo</username>
<funds>100.00</funds>
</userCommand>
<accountTransaction>
<timestamp>1167631200200</timestamp>
<server>CLT2</server>
<transactionNum>1</transactionNum>
<action>add</action>
<username>jiosesdo</username>
<funds>100.00</funds>
</accountTransaction>
<userCommand>
<timestamp>1167631201000</timestamp>
<server>CLT1</server>
<transactionNum>2</transactionNum>
<command>BUY</command>
<username>jiosesdo</username>
<stockSymbol>ABC</stockSymbol>
<funds>100.00</funds>
</userCommand>
<systemEvent>
<timestamp>1167631202000</timestamp>
<server>HSD1</server>
<transactionNum>2</transactionNum>
<command>BUY</command>
<username>jiosesdo</username>
<stockSymbol>ABC</stockSymbol>
<funds>100.00</funds>
</systemEvent>
<quoteServer>
<timestamp>1167631203000</timestamp>
<server>QSRV1</server>
<transactionNum>2</transactionNum>
<quoteServerTime>1167631203000</quoteServerTime>
<username>jiosesdo</username>
<stockSymbol>ABC</stockSymbol>
<price>10.00</price>
<cryptokey>IRrR7UeTO35kSWUgG0QJKmB35sL27FKM7AVhP5qpjCgmWQeXFJs35g==</cryptokey>
</quoteServer>
<accountTransaction>
<timestamp>1167631204000</timestamp>
<server>CLT2</server>
<transactionNum>2</transactionNum>
<action>remove</action>
<username>jiosesdo</username>
<funds>100.00</funds>
</accountTransaction>
<userCommand>
<timestamp>1167631205000</timestamp>
<server>CLT2</server>
<transactionNum>3</transactionNum>
<command>BUY</command>
<username>skelsioe</username>
<stockSymbol>DEF</stockSymbol>
<funds>1000.00</funds>
</userCommand>
<userCommand>
<timestamp>1167631205200</timestamp>
<server>CLT2</server>
<transactionNum>4</transactionNum>
<command>SELL</command>
<username>bob</username>
<stockSymbol>GHI</stockSymbol>
<funds>1000.00</funds>
</userCommand>
<errorEvent>
<timestamp>1167631206000</timestamp>
<server>CLT2</server>
<transactionNum>4</transactionNum>
<command>SELL</command>
<username>bob</username>
<stockSymbol>GHI</stockSymbol>
<funds>1000.00</funds>
<errorMessage>Account bob does not exist</errorMessage>
</errorEvent>
</log>