Depth first logging to file