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

Lost log data when files rollover


#1

Hello,

Using SmartInspect in an asp.net environment with the configuration below. I’m noticing gaps in logged data between log files as if maybe it didn’t flush before rollover or I have something configured wrong? But there are hours missing between files.

Is this correct?

string fileLog = string.Format("File(append = \"true\", filename = \"{0}\", rotate=\"weekly\", maxparts=\"4\", backlog = \"0\", caption = \"file\", flushon = \"error\", keepopen = \"false\", reconnect = \"false\")", logsPath);


#2

Hello Neal,

Thanks for your posting! The configuration looks good and we haven’t seen this behavior before. Are you sure that SmartInspect was enabled during this period? Did the logging stop at midnight and continued a few hours later? Would it be possible to switch to daily rotating to see if this makes a difference?

Cheers,
Tobias


#3

Hi Tobias,

The logging is always enabled. We had a break between about 2320 (prior to midnight) until about 0600 the next morning. We’ve seen this twice. We’ll continue to monitor, I just wanted to make sure my configuration was not the cause.

Thank you.


#4

Thanks, Neal. The configuration looks correct and I don’t see any problems with the configuration. Looking forward to your findings with the updated configuration.

Cheers,
Tobias


#5

I too have seen this behavior, but only when tracing processes that execute for long periods of time (e/g/ Windows Services). The configuration specifies a daily rotation, with max parts of 14. The log files will simply stop being created, and no trace data when you need it.

Note that restarting the Windows Service will immediately create the latest trace file with a datetime stamp of when the Service was restarted, and continue on for 14 days, then stops creating new files after that.

Here’s the “Connection” parameter that I use in my app.config:
“file(filename=“AppTrace.sil”, rotate=daily, maxparts=2, append=true)”

Any chance of a resolution?


#6

Hi Todd,

Thanks for your feedback. You can use the error event to check for any errors that occurred and this reports issues such as permission or other file related errors. This may already help troubleshoot this issue and the error event handler gets passed detailed information about what went wrong when SmartInspect tried to open or create a new file, for example.

I hope this helps!

Cheers,
Tobias