Graceful shutdown, exception logging