better handling of log files