Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create log file when it does not exist #4

Open
spyrospph opened this issue Jun 8, 2015 · 5 comments
Open

create log file when it does not exist #4

spyrospph opened this issue Jun 8, 2015 · 5 comments

Comments

@spyrospph
Copy link

Hi,

I use the below config:

'logFileName' => Yii::getAlias('@logs').'/output.log',
'updateLogFile' => true

When the logfile does not exist it does not get created so logs are being lost.

This is not the case with the error output used below, where if the log file does not exist it DOES get created?

'cron-stderr' => Yii::getAlias('@logs').'/error.log'

Any chance we can change the output so that the file is created?

@spyrospph
Copy link
Author

May we not add something like the snippet below:

            if (!file_exists($stdout)){
                touch($stdout);
            }

so that we create file instead of just having the is_writable check?

@spyrospph
Copy link
Author

please view in ths PR: #7

@alexweb-zz
Copy link

Currently when the log file doesn't exist we don't create it. Insted of this we attempt to save results into "/dev/null" Can we create log file instead?

@spyrospph
Copy link
Author

@alexweb we have done this here https://github.com/PeoplePerHour/yii2-cronjobs

it is based on denisogr work but with a few additions

@alexweb-zz
Copy link

@spyrospph thanks! Will try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants