I want to use the GPF Reporter template on an app that runs as a Windows Service. The template options allow for an email to be sent, but it seemingly needs UI interaction. As a service there won’t be UI interaction and all actions need to coded in. I may be able to pick up in the embeds for the global variable where a GPF report has been generated, and use the built-in email functions, or use the report content to send it myself. But I’m not sure where to do this, most of the embed points are for private methods and don’t seem to have a method for me to read the report content, or to set up the email credentials.
Any help on using GPF Report in a Windows Service will be great.
Its been a while since I last used GPFReporter, but one of the options was to generate a text file, so could you save that report in a folder and then have another app/service to look for new reports and then send them on via email?
You could probably do this with Nettalk, ie have a different service which monitors the folder for new reports and when it finds one, it sends it on via email automatically.
The forwarding service/process which detects a new report could also at the same, check to make sure the original service is still running. I know in window its possible to configure a service to restart automatically, but if the original service hangs, you need a separate service to kill the process and then restart it, because I dont think windows can tell when a service has hung.
You could also set up a pipe/file between the two services to poll each other to make sure everything is running properly.
As Richard says, you’re gonna use the log feature and email when the program starts, rather than on the gpf.
Make use of the restart-on-gpf feature, and simply send yourself the log in startup. Personally I wouldn’t use a different log file per incident, the built-in logging is designed to append, so with each event you’ll see the whole history, which can be really useful.
Spotting patterns like thread number, or keyboard etc. Plus complaints of “gpfs all the time” can be better understood as once-a-month or once-a-day and so on.