Improved end logging