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

Logfile Rollover and general syntax



I am very new to SmartInspect, and am having trouble getting my logfiles to append.

I have a hardcoded filename and location that I want to use.

So I used this: (VB.NET)

SiAuto.Si.Connections = “file(filename=c:\autoimport.sil, append=true)”

Yet each time I stop and restart the program the logfile seems to get overwritten.

I am also going to need to set up log rollovers for each day. I have read it will do various timestamps automatically on my file, will I still be able to specify the beginning part of the filename? Or do I just have to give it a certain directory?




Could you check that the log file is really truncated (i.e. checking the size of the log file in Explorer before and after starting your application)? A log file may appear truncated in case you log a Clear command at the beginning of your application to reset/clear the Console (e.g. via SiAuto.Si.ClearAll).

Log file rotation can be enabled as follows:

This creates a new file for each day (other rotate options are ‘hourly’, ‘weekly’ and ‘monthly’). Let me quote the manual for more details:

[quote]The rotate option specifies the date log rotate mode for this file protocol. When this option is used, the filename of the resulting log consists of the value of the filename option and an appended time stamp (the used time stamp format thereby is “yyyy-MM-dd-HH-mm-ss”).

As example, if you specify “log.sil” as value for the filename option and use the Daily rotate mode, the log file is rotated daily and always has a name of log-yyyy-MM-dd-HH-mm-ss.sil.

To control the maximum amount of created log files for the rotate and/or maxsize options, you can use the maxparts option. The default value for maxparts is 2 when used with the maxsize option, 0 when used with rotate and 0 when both options, maxsize and rotate, are used.[/quote]

So, yes, you can specify the filename and SmartInspect just adds the time stamp for rotate purposes.

This help can be found in the SmartInspect manual (press F1 in the Console) and then go to Working with SmartInspect | Connections and Protocols | File. Just let me know in case there’s anything else I can help with.