fix early log files and sanitize variables