made logfile name & encoding configurable