enahnced -log so it will create leading directory if specified