Find end of log more efficiently. #1106