This article describes how to enable the log file that records the start time of applications and the Minimal Disconnected Operation (MDO) mode information when you use the Microsoft SoftGrid for Terminal Services client and the Microsoft SoftGrid for Windows Desktops client.
When you use the SoftGrid Client 3.0 Service Pack 2 (SP2) or a later version of the SoftGrid Client, you can generate a log file that records the following information:
- The date and time when a user starts an application
- The date and time when a user shuts down an application
- The date and time when an application does not start successfully
- The date and time when MDO starts and stops
You can also configure SFTTray.exe to log the same information in the event log.
Registry entries that are required to enable the log file
To enable the log file, you must add registry entries under the following registry subkey:
You add the following registry entries:
To generate a log file, you must specify a full path for this value. The users whose activities you want to log must have permission to create and to write to the log file.You can configure the client to write to a log file on any computer to which the user has access. This includes local paths and network shares that have Universal Naming Convention (UNC) names.
Use this value to enable or to disable logging individually for any of the five events if the LaunchRecordLogPath value is set. If LaunchRecordMask is not present, all file-based logging will be enabled. If LaunchRecordMask is present, you can set the five least significant bits (hexadecimal 0x1, 0x2, 0x4, 0x8, and 0x16) to enable start messages, error messages, shutdown messages, disconnect messages, and reconnect messages, respectively.
Whether or not you set LaunchRecordLogPath, you can use LaunchRecordMask to enable logging to the event log. You can use the bits at hexadecimal 0x10000, 0x20000, 0x40000, 0x80000, and 0x100000 to enable event logging for the start messages, the error messages, the shutdown messages, the disconnect messages, and the reconnect messages, respectively. You can combine these with one another and with the bits that control file-based logging.
By default, start errors will be logged to the event log only if you enable file-based logging by setting LaunchRecordLogPath.
Because values for LaunchRecordMask can be confusing to figure out, some common combinations are documented in the following table.
|Value (hexadecimal)||Value (decimal)||Event log ||Log file|
|0x00020000||131072||Start errors are written to the event log.|
|0x00020002||131074||Start errors are written to the event log.||Start errors are written to the log file.|
|0x0002001A||131098||Start errors are written to the event log.||Start errors are written to the log file. MDO entries and exits are written to the log file.|
|0x0000001F||31||All events are written to the log file.|
|0x00000002||2||Start failures are written to the log file.|
|0x0000001A||26||Start failures and MDO activity are written to the log file.|
|0x001A001A||1703962||Start failures and MDO activity are written to the event log.||Start failures and MDO activity are written to the log file.|
|0x00020001||131073||Start failures are written to the event log.||Start successes are written to the log file.|
|0x00000018||24||MDO activity is written to the log file.|
|0x00100000||1048576||When an application goes MDO, an informational message is written to the event log.|
Description of the information in the log
The log file contains one record per line. Each record contains five fields. These fields are separated by single tab characters. The fields contain a time stamp, the user name, the computer name, the application name, and an event.
The application name is the NAME attribute and the VERSION attribute from the SOFTPKG element in the .osd file of the application.
The event field contains the following terms:
- Launched: This term indicates a successful start.
- Error "code": This term indicates a failed start. In this term, "code" is a placeholder for the 22-digit Softricity error code.
- Shut down: This term indicates an application shutdown.
- Disconnected: This term indicates that an application entered MDO mode.
- Reconnected: This term indicates that an application left MDO mode.
Messages that are recorded in the log
The event log records the following messages:
- The date
- The time
- The user name if the user is logged in to a domain account instead of to a local account
- The computer name
- The error source (This will always be “SoftGrid Client” for these messages.)
The user name will also be added to the body of the messages that SFTTray.exe generates for those cases in which users are not logged in to a domain. This occurs even though this process is redundant when the users are logged in to a domain.
These five messages have the following types and formats:
- Informational: User user started SoftGrid application application name and version.
- Error: The SoftGrid application application name and version failed to launch for user user with error 22-digit error code.
- Informational: User user shut down SoftGrid application application name and version.
- Informational: User user entered disconnected mode for application name and version.
- Informational: User user left disconnected mode for application name and version.
Generally, it is a bad practice to write messages to the event log for frequent events, such as successful starts. The functionality is included for completeness and because it may be useful in some debugging situations. However, it should be a very rare occurrence to log anything other than start failures to the event log.
Be aware that for some errors, the name of the application is unknown. This condition can occur if the error occurs before the client core can open the .osd file, can parse the application name, and can return the application name to SFTTray.exe.
In this case, the application name in the log is replaced by the parameter that was passed to SFTTray.exe on the command line. This parameter can be one of the following items:
- An .osd path
- The path of a document that is to be opened (for a file type association)
- The name and version of the application (for a published shortcut)
This means that most of the time, the name and the version of the application appear in the log. However, sometimes this will not be true. In these cases, the path of an .osd file or of a document appears instead.
Someone who reviews the log must manually use the same algorithm that the client uses to figure out what application was being started. If the application is an .osd file, the reviewer must open the file and see what name or version is in the file. If the application is a document, the reviewer must determine what application is associated with files of that type.Note
Only applications that are managed by SFTTray.exe cause events to be written to the log file or to the event log. Starts that SFTRun.exe performs are not logged. No changes will be made to the installer to let this feature be enabled or disabled at installation time.
Because the log is generated by SFTTray.exe, the log contains exactly what a user sees for starts and failures. This is unlike the client log. In the client log, some failures do not appear because SFTTray.exe cannot connect to the listener service to report the failures.
A typical log resembles the following log.
01/23/2004 18:19:03.142 username computername Microsoft Word 2000 Launched01/23/2004 18:21:10.784 username computername Microsoft Word 2000 Disconnected01/23/2004 18:31:10.927 username computername Microsoft Word 2000 Reconnected01/23/2004 18:33:42.873 username computername Microsoft Word 2000 Shut down01/23/2004 18:33:46.013 username computername Microsoft Excel 2000 Error 300210-03209403-00004004
Event IDs that are recorded in the log
|2001||Informational||The SoftGrid Core Service started.|
|2002||Informational||The SoftGrid Core Service stopped.|
|2003||Warning||Warning An attempt to shut down the SoftGrid Core Service failed because users are still connected.|
|2004||Error||The SoftGrid Core Service could not start because no valid license was available.|
|2005||Error||The SoftGrid Core Service could not contact the Service Control Dispatcher.|
|2006||Error||The SoftGrid Core Service could not register its service control handler.|
|2007||Error||The SoftGrid Core Service failed to initialize correctly.|
|2008||Error||The SoftGrid Core Service could not start due to a COM initialization error.|
|2009||Error||The SoftGrid Core Service could not start because a driver failed in a previous run.|
|2010||Error||The SoftGrid Core Service could not start because a driver failed to respond.|
|2011||Error||The SoftGrid Core Service could not start because the Application Manager did not initialize.|
|2012||Error||The SoftGrid application '%1' failed to launch for user %2 with error %3.|
|2013||Informational||User %1 launched SoftGrid application '%2'.|
|2014||Informational||User %1 shut down SoftGrid application '%2'.|
|2015||Informational||User %1 entered disconnected mode for '%2'.|
|2016||Informational||User %1 left disconnected mode for '%2'.|