I have a windows c# program (.net 3.5) that runs in the background on a real time controller (Windows 7 Embedded).
After a few days the process apparantly terminates. Now I am thoroughly logging the actions and exceptions of my program. Everything that can throw an exception is surrounded by try/catch and is being writting to a log file, and if the logger has an exception that is written to the windows event log.
But there is nothing in the logs that hints to an exception that could cause a program termination.
Are there other techniques to catch and log program termination?
So far I couldn't reproduce the bug in an online debug session.
The program itself is very simple. It uses two stopwatches and spawns a thread to communicate with a real time program. It writes an 'alive' boolean, an 'error' integer and reads another integer. The log file size is limited to 10 MBytes. If the size is reached, the file is renamed with a date and a new file is opened. Files older than 30days will be deleted.
I have checked the windows event logs and couldn't find anything that directly relates to the program.
What would you do?