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

Windows Service Logging


#1

Hello,

I’m trying to use SI for debugging a windows service, and I’m getting some messages through and not others.

Eg in a loop in OnExecute, I can get a counter incremented, but a string that is being logged is not displaying.

FormCreate successfully logs a string. (The only statement in the FormCreate)

Occasionally I get a string in the AfterStart event.

This is just basic service doing nothing, as it is the first time I’ve attempted to write one and want to get the logging going as the first step.

Any ideas ? I must be missing something. I thought I had it going last week, but today, no joy.

SmartInspect V3.3.3.72; Win64, Delphi XE, not running as an administrator; tried with both TCP and Pipes.

TIA

Sue


#2

Hello Sue,

Thanks for your posting. Do you have a filter activated for your view(s) in the Console that would hide some messages? You can also check the Connection Log in the Console (File | Connection Log) to see if the connection can be established correctly or if there may be a connection error. On the client-side in your application, you can check for such errors with the Si.OnError event.

I look forward to your reply.

Regards,
Tobias


#3

Hello Tobias,

Thanks for your response.

There were no filters active in the Console.

I checked the Connection Log, and the connections were displayed. The version no for the client showed as 3.3.3.49. I thought this was wrong, and although my installed seemed OK, decided to reinstall 3.3.3.72.

After doing this, the Client version on connect in the connection log still shows 3.3.3.49. However the logging appears to be working correctly.

Thanks for you help,
Sue


#4

Hello Tobias,

This is a follow up for others who might have the same ‘problem’, as although it appeared OK when I first ran it after the re-install, on further testing I had the same ‘problem’. Now I am not sure whether I saw the events coming through for the process immediately after the re-install or not. I’ve since restarted the console and can’t check.

I found that to get messages from the execute thread to display for the process, I needed to create a new session for the execute thread. I rarely look at ‘All Log Events’ so had not noticed previously that the messages were being displayed there.

It seems obvious in hindsight, but wasn’t immediately to a service newbie.

Sue


#5

Hello Sue,

Thanks for the update. Issues like this are often related to views/filters but it’s good to hear that it works now.

Regards,
Tobias