sort logs