Fix temp file usage in XConfig::Save, add logging