Write PHPDoc
Fix a bug that it throws an exception when a passed log file does not exist

Check permission of a log file only when it exists
Fix the bug which checks permission even when file is not passed
Add tests