Only log tree if there are documents