Add debug logging for why application is stopped unexpectedly.