Microsoft KB Archive/931252

= How to enable the log file that records the start time of applications and the MDO mode information in SoftGrid =

Article ID: 931252

Article Last Modified on 5/24/2007

-

APPLIES TO


 * Microsoft SoftGrid for Terminal Services
 * Microsoft SoftGrid for Windows Desktops

-



INTRODUCTION
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.



MORE INFORMATION
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:
 * LaunchRecordLogPath
 * LaunchRecordMask

LaunchRecordLogPath
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.

LaunchRecordMask
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.

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 &quot; &quot;: This term indicates a failed start. In this term, &quot; &quot; 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  started SoftGrid application.
 * Error: The SoftGrid application  failed to launch for user   with error.
 * Informational: User  shut down SoftGrid application.
 * Informational: User  entered disconnected mode for.
 * Informational: User  left disconnected mode for.

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 Launched 01/23/2004 18:21:10.784 username computername Microsoft Word 2000 Disconnected 01/23/2004 18:31:10.927 username computername Microsoft Word 2000 Reconnected 01/23/2004 18:33:42.873 username computername Microsoft Word 2000 Shut down 01/23/2004 18:33:46.013 username computername Microsoft Excel 2000 Error 300210-03209403-00004004

Event IDs that are recorded in the log
Keywords: kbexpertiseinter kbhowto KB931252

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.