Logs are sorted by id, closes #607.