fixed error when log file doesn't exist
combined exists and writable into a single if-condition
Merge pull request #1 from tonymcdaniel/master

fixed error when log file doesn't exist