added log file check and creation