Catch exits to make sure we have logs.