Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Web Server SI Log - client session info


We have a new Web application in and have purchased SmartInspect. My question is this: what techniques and/or best practices should be used when logging from multiple client sessions to the same log? Should we log any session-specific or user-specific information to enable the log to be searched in support of a specific user trouble ticket?

We work in DEV using TCP direct to the Console but in QA they log to a file and often need to see log messages for their session. Is there a way to provide this info in the log automatically?

These may be “stupid” questions as I have more experience with batch and the middle tier or business layer than as a Web developer.

Thanks in advance.



For web applications, we usually recommend using a dedicated SmartInspect session for each client session. SmartInspect sessions are used to group messages into a logical unit and are intended for filtering (in the SmartInspect Console and/or directly in the application). The name of the SmartInspect session could then consist of the client session ID and/or logged-in user. We have an example in the examples section (aspnet-advanced) of the SmartInspect installation directory which demonstrates this session approach. This approach has several benefits:

  • You can create views in the Console to show the log messages for one or more specific client session(s) only. These views allow you to analyze certain client sessions (for example, a client session for DEV or QA) independently from other log messages. The Console even has the ability to create these views automatically if you like (via session AutoViews, see “Edit | AutoView Rules” in the Console).

  • You can enable/disable certain SmartInspect sessions. The Active property of SmartInspect sessions can be used to control if logging should be enabled for a particular session or not. One way to use this property is as follows. When a new client session is created for a particular user, the Active property can be loaded from a database and dynamically assigned to the related SmartInspect session. This way, it is possible to dynamically configure the logging on a per-session basis.

As a side-note, for easy switching between DEV and QA, I recommend using SmartInspect configuration files which can contain a SmartInspect connections string, log levels, the enabled status and more. Please see the “Working with SmartInspect | Library Configuration Files” topic in the SmartInspect online help (press F1 in the Console) for more information.

Please let me know if you have any further questions.