What's New in SmartInspect 3.0

Note: Announcements and change logs of minor releases are now published in our support forum instead.

SmartInspect 3.0 is by far the best release of SmartInspect that we ever published. It comes with dozens of new features, improvements and bug fixes that are directly based on customer feedback. This version introduces a new log server application (SmartInspect Router), a high-performance named pipe protocol for local live logging, asynchronous logging for even better logging performance, the ability to encrypt log files, a redesigned and more flexible log rotation mechanism, a sort feature in the Console to merge multiple log files, various session related enhancements and a lot more.

For users with an active support plan, SmartInspect 3.0 is a free upgrade. If your support plan isn't current, just extend your support plan on My Gurock.com to gain access to this new version.

High-performance named pipe protocol

SmartInspect 3.0 comes with an all-new logging protocol for local live logging. The new named pipe protocol is perfect for high-performance and reliable logging to a local Console or to the new SmartInspect Router service application. Besides offering improved logging performance, the named pipe protocol can be kept enabled at all times without blocking the application – even when no Console is running. And once a Console is started, the live logging messages appear immediately.

Watches Graph

This makes the named pipe protocol perfect for production systems or for debugging server applications. Because of the superior performance and behavior when compared to TCP/IP, named pipes allow you to inspect your application with the Console whenever you want.

Log file encryption

Also new in SmartInspect 3.0 is encryption support for log files. It is not unusual to write proprietary and sensitive information (such as implementation details) to log files that have to be protected from third-parties or even customers. The SmartInspect libraries now support a new file protocol option to encrypt log files with a configurable secret key. And when you open an encrypted log file in the SmartInspect Console, you can easily decrypt and open it:

enterkey

SmartInspect uses the secure and fast AES (Rijndael) encryption algorithm. We decided to use 128-bit keys since they are not subject to export restrictions, are sufficient secure and offer the best performance.

SmartInspect Router log server

With SmartInspect 3.0 we are introducing a complete new service application: the SmartInspect Router. The Router can receive logging data via TCP/IP and named pipes from multiple applications and besides other things, route it to log files.

The SmartInspect Router service application is ideal for debugging and monitoring complex production systems. And because the Router can be configured by using custom rules, it is possible to merge logging data from different processes or machines into a single log file.

Router

The SmartInspect Router can also act as a log server in your network to store logging data in a central location. This makes it a lot easier to use SmartInspect with clusters, in multi-server environments and for web applications.

Redesigned log rotation support (with max parts)

Rotating log files and archiving logs is useful to keep the size of individual log files small and to limit the amount of disk space your log files consume. SmartInspect 2.x already came with options to rotate log files, but SmartInspect 3.0 introduces a completely redesigned log rotation feature to make it more flexible and useful. The following options are available:

  • Rotation by date/time
    You can configure SmartInspect to generate new log files periodically. This allows you to rotate log files by hour, day, week and so on. This is especially useful for server systems where a steady stream of log entries and messages are generated. Log rotation by date makes it also very easy to use log files for auditing purposes because you know exactly what time frame a log covers (the log file names contain time stamps). New in SmartInspect 3.0 is the option to specify how many log files SmartInspect should manage. Limiting the amount of log files is a great way to keep disks clean of old log files.

  • Rotation by size
    Similar to rotating log files by date and time, SmartInspect offers you the option to rotate log files by size. If you need to keep individual log files small (to make it easier to email them, for example), you can easily specify that SmartInspect should start a new log file once the current log reaches a certain size. SmartInspect 2.0 only allowed you to rotate between 2 log files when this option was used. This limitation is now gone and you can freely configure how many files SmartInspect should generate (5 files of 10MB, unlimited files of 1MB and so on).

  • Combining log rotation options
    You can now also combine both log rotation options. You can thus specify a maximum log file size and also tell SmartInspect to rotate log files at least once per time period. SmartInspect enforces the limitation that it first encounters and automatically rotates the log files and appends the current time stamp to the new log file name.

Session improvements

The most frequently asked for improvements for sessions in the libraries have been implemented for SmartInspect 3.0:

  • The first new feature in SmartInspect 3.0 regarding sessions is the new log level support. This is probably the most often requested session related feature that we incorporated into the new version. Log level support for sessions means that you are now able to configure log levels on a per-session basis. This allows you, for example, to only log errors and warnings in your application, except for your database module where you want SmartInspect to generate a very detailed log (e.g., for debugging or auditing purposes).

  • Another improvement in SmartInspect 3.0 is the new ability to configure sessions via SmartInspect configuration files. This allows you to enable, disable or configure specific sessions without recompiling your application. This can come in very handy if you have to dynamically enable or disable logging for certain application modules on production systems or at customer sites.

; General logging options
connections = file(filename="c:\log.sil")
enabled = true

; Set the defaults for new sessions
sessiondefaults.active = false
sessiondefaults.level = message
sessiondefaults.color = 0xffff7f

; And configure individual sessions
session.database.active = true
session.database.level = verbose
  • Also a new session enhancement in SmartInspect 3.0 is the support for so-called session defaults. Session defaults let you specify default values for session attributes like the Active status or the background color of log entries in the Console. This is very useful in situations where you are working with many sessions and need a way to change the base settings of all instances.

Configuration timer support in the libraries

To make configuration files more useful in production environments, we added a new feature to SmartInspect 3.0 that allows you to periodically reload changes in your configuration file. Here is how it works: you create an instance of a new SmartInspect monitoring class and use it to watch for changes in a configuration file in a given time interval. Once this class detects that the monitored configuration file has been changed, it will automatically reload the file and apply the new configuration to the SmartInspect logging classes.

// Configure a new SmartInspect instance to automatically check
// for changes in a configuration file every 60 seconds.
SmartInspect si = new SmartInspect("Order System");
var timer = new ConfigurationTimer(si, 
	"logging.sic", 60000);

The ability to automatically reload configuration files is perfect for systems where you want to enable or disable logging on the fly without restarting them (think web applications and similar server systems). With the new configuration file monitoring class, this has become a lot easier. You just need to change the configuration file and SmartInspect will now automatically reconfigure itself.

Asynchronous logging support

SmartInspect 3.0 introduces a new protocol option for asynchronous logging. Asynchronous logging basically moves the protocol/connection related operations (such as writing a packet or doing a reconnect attempt) from your application thread into a dedicated logging thread.

Asynchronous logging was added to SmartInspect to reduce the possibility of blocking the application while doing an I/O operation. I/O operations are usually very expensive and can thus be a problematic part of your logging layer, especially in performance-critical applications.

Asynchronous logging is especially useful for logging over a network via TCP/IP. When a network problem occurs while you are logging over TCP/IP, the application usually blocks until a timeout is reached. With asynchronous logging, the timeout doesn't affect your application at all. The separate logging thread and not your application is now doing the waiting for the remote machine.

Sort Packets

The SmartInspect 2.x Console already allowed you to open multiple log files at the same time. However, the Console only added log entries to the bottom of the active log and didn't merge it. The new Sort Packets feature allows you sort log entries by time and thus merge multiple log files. This is very useful if you need to merge log files from multiple processes and to see log entries of different processes in context.

Sort Packets

File buffering option

SmartInspect usually doesn't use any buffers when writing data to log files. We do this to make sure that all log entries have been written in case of an application crash. However, in some situations performance is more important than guaranteeing that all log entries are written. For these cases, SmartInspect 3.0 comes with a new configurable buffer option to make the file protocol even faster.

Timer Calibration

SmartInspect comes with high-resolution timers to measure log entries in microseconds. This is very useful for profiling your application and for finding bottlenecks. To make the timers work reliable over multiple processes (ie, so that all processes use the same base time), SmartInspect comes with a new calibration method to synchronize the time.

Go to Time

The new Go to Time dialog allows you to quickly jump to a log entry that occurred at a specific time. Imagine if an end-user reports an application crash and sends you a large log file to identify the issue. To make it easier to find the problem, it's often useful to know at what time the crash occurred (especially if the log file includes log entries from multiple days). If your customer can provide you with the time the crash occurred, you can now easily jump to the relevant log entries with the Go to Time dialog.

Go to Time

View Synchronization

If you are working with multiple views in the Console, you have probably been in a situation where this new feature would have been handy. The Synchronize View feature allows you switch the view and jump to the currently selected log entry at the same time. Imagine that you have a custom view that only contains the errors that occurred in your application. You can now simply select the error and jump to it in another view and see the error in context with all the surrounding log entries.

View History

The new view history is very similar to the history feature of modern web browsers. It provides you with Back and Next buttons to easily jump to the next and previous views you have been looking at. This is especially useful if you are working with many views. You can also view the history and directly select and jump to a view:

View History

Reconnect Intervals

The new reconnect interval protocol option allows you to configure how often the SmartInspect libraries should try to (re-)establish a connection. This allows you to specify, for example, that SmartInspect should only retry to establish a failed TCP/IP connection every 5 minutes.

Named Checkpoints

The existing checkpoint feature of SmartInspect is already very useful. Basically, if you call the AddCheckpoint method of a SmartInspect library, it increments an internal counter and logs a message. This allows you to easily track how often a loop is executed or how often a specific method is called. The new named checkpoint feature enables you to have multiple counters at the same time and to also assign them a name to display in the Console.

Delphi IDE Plugin

Not exactly a new feature (the instrumenter has been available as a beta version from our site for quite some time now), but the Delphi IDE Plugin is now integrated with the SmartInspect setup and is fully supported by us. The Delphi IDE Plugin enables you to automatically add Enter- and LeaveMethod calls to your Delphi code. We did a video of the instrumenter when the first beta was released.

Delphi IDE Plugin

LINQ logging with SmartInspect (.NET only)

LINQ and LINQ to SQL, Microsoft's data querying language and ORM for .NET and SQL Server, allows developers to easily query databases without writing data access code or SQL statements. Although Microsoft built a great abstraction for working with data and made it a lot easier to build queries, it's often still useful to take a look at the underlying SQL queries that LINQ generates.

We added a feature to SmartInspect's .NET library that allows you to use LINQ's logging capabilities with SmartInspect. By using this feature, you are able to live monitor the generated SQL queries directly in the Console or save the queries to log files for later analysis.

private IList<Order> GetOrdersByYear(int year)
{
	// Enable SmartInspect logging
	SiAuto.Si.Enabled = true;

	using (var db = new NorthwindDataContext())
	{
		// Attach SmartInspect logging
		db.Log = new SmartInspectLinqToSqlAdapter();

		var query = from o in db.Orders
			where
			o.OrderDate >= new DateTime(year, 1, 1)
			o.OrderDate <= new DateTime(year, 12, 31)
			select o;

		// Execute the query
		return query.ToList();
	}
}

When the LINQ SQL statements are viewed in the SmartInspect Console, you can easily inspect them with the built-in SQL / source viewer:

LINQ Logging

The SmartInspectLinqToSqlAdapter class is one of several adapters to make it easier to use SmartInspect with other platform and third-party logging classes.

All changes at a glance

The following list displays all changes of the SmartInspect 3.0 release at a glance:

Libraries

  • Added: Pipe protocol for sending log packets over a named pipe to a local Console
  • Added: Configuration timer for automatically reloading SmartInspect configuration files on changes
  • Added: Log file encryption for automatically encrypting SmartInspect log files
  • Added: Asynchronous logging
  • Added: New buffer option in the file protocol for I/O buffering which greatly improves the logging performance
  • Added: New maxparts option in the file protocol for specifying the maximum amount of log files in log rotate mode
  • Added: Session log levels
  • Added: Session defaults for specifying the default values for newly created sessions
  • Added: Session configuration file support for loading session properties from a SmartInspect configuration file
  • Added: Reconnect intervals for improved control over the reconnect protocol option
  • Added: Named checkpoints log methods
  • Added: The Delphi IDE plugin is now officially included in SmartInspect (we also added a few minor feature requests and fixed a few problems since the first beta release)
  • Added: LINQ to SQL adapter class for logging sql statements generated by LINQ to SQL (.NET only)
  • Added: High-resolution timer calibration for improved system clock synchronization
  • Added: SmartInspect.dispose and Protocol.dispose methods (Java only)
  • Changed: The default connections string of SiAuto has been changed to using the new pipe protocol
  • Changed: Removed obsolete Delphi units
  • Changed: Session names and named counters are now handled case insensitive
  • Changed: Moved existing compatibility layers into their own assemblies/libraries and adjusted their namespaces
  • Changed: Redesigned log rotating (log files can now be rotated by size and date at the same time; also, rotating by size now also includes the time stamp in the log file name)
  • Fixed: A possible memory leak in the backlog protocol feature has been resolved

Console

  • Added: Pipe server for receiving packets from the libraries with the new pipe protocol
  • Added: Log file decryption support
  • Added: Sort dialog for sorting log packets based on their timestamps
  • Added: Go to Time dialog for quickly finding a Log Entry based on its timestamp
  • Added: Synchronize dialog for quickly jumping to the currently selected Log Entry in a different view
  • Added: Backward/Forward to navigate through the view history
  • Added: Browse History dialog for browsing the view history
  • Added: 'From end' origin option for the Find dialog
  • Changed: Link in serial number form on startup now points to http://my.gurock.com/
  • Changed: Go to Method dialog displays Log Entry colors now
  • Changed: Connection Log dialog is now resizable
  • Changed: Go to Method dialog is now resizable
  • Changed: Auto Scroll is now enabled by default
  • Changed: Greatly improved the overall responsiveness and performance with many clients
  • Fixed: Incoming packets are now displayed in the order as they are received
  • Fixed: Disable Ok button in Go to Method when the search tree is not focused
  • Fixed: A possible exception when closing the Console with an undocked Watches Graph toolbox has been resolved
  • Fixed: Recent Logs labels in the Tasks toolbox are now dynamically sized
  • Fixed: Tray menu now behaves correctly in Start to Tray mode
  • Fixed: Toolbars of undocked toolboxes now paint correctly on start
  • Fixed: A possible Access Violation when closing the Console from the tray with undocked toolboxes has been resolved

Router

  • Initial release of our new SmartInspect Router log server for receiving log packets from the SmartInspect libraries via TCP/IP or named pipes.

Configuration Builder

  • Added: Support for asynchronous options
  • Added: Support for pipe protocol
  • Added: Session configuration file support
  • Added: Support for reconnect interval option
  • Added: Support for file buffer option
  • Changed: Builder now only includes the connection options in the output that differ from the default values

A fully functional trial version of SmartInspect 3.0 can be downloaded from our Download page. Orders can be placed in our Online Store. SmartInspect 3.0 is a free upgrade for existing users with an active support plan. If your support plan isn't current, just extend your support plan on My Gurock.com to gain access to this new version.