more flexible filtering and sorting for logs