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

Appname Variable not working in Router


Hi -

I’m sure I’m overlooking something quite simple but I’m unable to get the SmartInspect router to behave in the fashion I’m expecting…

The configuration document looks like this:

[code]<?xml version="1.0" encoding="utf-8"?>

        <connections>file(filename="F:\M5\Logs\log %appname%.sil", rotate="hourly", append="true")</connections>


and the name of the application logging is “Test”.

So I’m expecting to find a log file at F:\M5\Logs\log Test-2010-04-10-01-21-14.sil
but I’m always rewarded with F:\M5\Logs\log Auto-2010-04-10-01-21-14.sil

When viewing the log the “Application” field correctly identifies the name as “Test” but the router apparently insists on calling it “Auto”.

What have I missed?

Kind regards… Allan


Hello Allan,

The Router uses the standard AppName property of the SmartInspect object as application name. You are probably using SiAuto.Si and the AppName is set to ‘Auto’ by default. It is important that the AppName property is set to the real name of your application before connecting to the router:

SiAuto.Si.AppName = "Some Test"; SiAuto.Si.Connections = ".."; SiAuto.Si.Enabled = true;

The Router is sent a special log packet (LogHeader) after connecting which contains the application name and other properties. This packet is used as the value for the route trigger and route variables. If you are setting the AppName after connecting, this would explain why the log file is created with ‘Auto’ instead of ‘Test’.



Hi Tobias -

I don’t think that can be the problem… the technique I’m using involves the built-in method:


as opposed to assigning everything by hand. The config file itself looks like this:

AppName = Test Connections = tcp(port="57501", level="verbose") DefaultLevel = Verbose Enabled = True Level = Verbose

and the application name is the very first thing assigned.


Thanks for the update. The order in the configuration file is not necessarily the order the properties are assigned in the LoadConfiguration method. I’ve just checked it and the application name is indeed assigned after the connection string and enabled property (you can take a look at the LoadConfiguration source code in the SmartInspect.cs file, about line 1500). This would explain the behavior you’ve seen.

I will try to reproduce the behavior here and fix the assignment order in LoadConfiguration for the next release (we are currently working on SmartInspect 3.3 with .NET 4.0 and Visual Studio 2010 support, the new version should be available soon). Thanks for reporting this issue and have a nice weekend!