[Reviewer Andy] Issue178

Andy

As discussed, can you review - as well as fixing the SAS problem in issue178 it also improves other error behaviour, and the logging.

While testing this I hit a seeming rare problem with failing to open a log file, so I rejigged the logging code to handle this, periodically retrying the open and counting the discarded logs in the mean time.

Mike