avoid setting logfile path too early, from #37802