add log sorting