Help on Phalcon\Logger\Adapter\File() how to detect if not exist?

How can I check if file does not exist? or force create a file?

I found this on the documentation and it's not working.

<?php

use Phalcon\Logger\Adapter\File as FileAdapter;

// Create the file logger in 'w' mode
$logger = new FileAdapter("app/logs/test.log", array(
    'mode' => 'w'
));


753

chmod 777 app/logs

if it not resolved you have to change permission group and user in your folder "logs"