sort logs by time