Log process endings

Trying to hunt down the cause of the hang on sqlite errors