Last updated May 23, 2007

Logging from Java

Table of Contents

1. Introduction

Logging is the process by which a CTAT tutor records all interactions between the student and tutoring system, and stores those records in a file on the filesystem of the computer running the tutor, or sends them to a log server for storage.

This article explains how to configure a Java-based CTAT tutor to log, and how to verify that logging of a Java-based tutor is working properly. Logging configuration is a relatively straightforward process, but it is not automatic: you need to configure each tutor with logging parameters, and verify that logging is working.

To configure a Java tutor for logging, you will:

  • Configure CTAT preferences for logging; and
  • Set logging parameters as arguments to the Java command that runs the tutor.

These steps are detailed in the following sections.

For Web Start tutors (Java tutors delivered over the web), logging configuration is done while using the interactive Ant script that generates your WebStart files. For more information, see "Java - Web Delivery (Web Start)".

1.1 The format of logged data

Log data is created in an XML format that conforms to the PSLC tutor_message DTD, a standard vocabulary for describing tutoring sessions. For more information about the tutor message DTD, see the DTD page on the DataShop web site.

2. Configuring logging

2.1. Configure CTAT preferences

The first step in configuring logging of Java-based CTAT tutors is to enable it. When enabling logging, you have two options:

  • Log to disk: log data is stored in files on the hard drive of the computer running the tutor)
  • Log to remote server: log data is sent over the network to a dedicated logging server (a server running the OLI log service).

You can enable either logging type, or even both, as follows:

To enable logging to disk:

  1. In CTAT, select Tools > Preferences.
  2. Under the General category, select Log to disk.
  3. Set a disk logging directory by clicking Browse, or use the default (a dot), which maps to the current directory where CTAT was started.
  4. Click OK to save your changes and close the preferences window.

To enable logging to remote server:

  1. In CTAT, select Tools > Preferences.
  2. Under the General category, select Log to remote server.
  3. Enter a URL under Logging Server URL. To test logging, set this value to http://pslc-qa.andrew.cmu.edu/log/server. When done testing, set to http://learnlab.web.cmu.edu/log/server.
  4. Click OK to save your changes and close the preferences window.

Important: If you are installing your Java tutor on multiple computers, these logging preferences must be set on each computer running the tutor. To do this efficiently and to ensure that the same preferences are on each machine, set the logging preferences in CTAT on one computer; then copy the file brPrefs.xml (located in the CTAT installation directory) to the CTAT directory of each computer running the tutor. Then test logging on each computer!

2.2. Set logging parameters

"Logging parameters" refers to the data that describe the context of your tutor—the name of the course or study in which it appears, the name of the school (if your tutor is being used in one).

As of CTAT 2.1, four logging parameters can be set for Java-based tutors. These are defined in the Table-1 below.

To set logging parameters for a Java tutor:

  • Specify each parameter as system property argument to the Java command that launches the tutor, each given in the form -Dparameter_name=value.

Example: to set the parameters course_name to "MyCourse" and school_name to "MySchool", you would use a command similar to the following:

java -cp "lib/DorminWidgets.jar;Projects" \
  MyTutor.TutorInterface -Dcourse_name=MyCourse -Dschool_name=MySchool \
  -DProblemFileLocation=ProblemsOrganizer\start.brd \
  -DBehaviorRecorderVisible=false %* 
Table 1. Logging parameters for Java tutors (CTAT version 2.1)
ParameterDescription
course_name Logged as the dataset name. In DataShop, this value will differentiate the data from other projects. If omitted, this value is taken from the top-level folder within the Problems Organizer hierarchy that contains the loaded behavior graph.
school_name Logged as the school name. If omitted, the school element will be omitted from the log.
unit_name Logged as the unit name of a unit-section hierarchy. If omitted, this value is taken from the second-level folder within the Problems Organizer that contains the loaded behavior graph.
section_name Logged as the section name of a unit-section hierarchy. If omitted, this value is taken from the third-level folder within the Problems Organizer that contains the loaded behavior graph.

3. Test and troubleshoot logging

To verify that logging is enabled and working properly, use your tutor—exactly as a student would, in the same environment as the student would—to generate some log data. To be absolutely certain logging is working correctly, record exactly what you did with the tutor (eg, the buttons you pressed, the values you entered, in the order you performed).

Next, inspect the log file(s) (in the case of disk logging) or logging database (in the case of remote server logging). Your approach for verifying log data will depending on the logging method you are using.

For disk logs:

The "relevant" data in disk logs are initially escaped, that is, any character that might cause the XML to be malformed is transformed to a safer percent-encoded value (percent sign followed by two-digit hexadecimal value), making it safer for transmission but more difficult to read the log file. To make the log file contents more readable, you will need to "unescape" the log data using a program or macro. A utility included with CTAT called LogFormatUtils can be used to transform the log data into a format that you can then open in Excel or another spreadsheet editor.

For remote server logging:

To verify data is being received by a remote log server, you need to examine the log service database, or communicate with the server administrator to get access to those logs. If you're logging to either of the PSLC log servers, contact the DataShop team to find out the results of your logging test.

For strategies on troubleshooting remote server logging, see Flash Logging Troubleshooting.

Back to top