better logfile handling