append logs into files
fix sample code issue
replace generated target folder by a temporary one