Add exit logging