Closed clemorphy closed 8 years ago
Hi,
silent=false
is just there to display the list of due jobs and to know if they were executed synchronously or asynchronously. There's not way to get the output of an asynchronous job since it is run in the background.
What do you mean with "it doesn't when called via CLI"?
Here's the expected behaviour:
GET /cron
or php index.php /cron
should both display the list of due jobsJob1 [OK]
, it means that the job has been executedJob1 [async]
, it means that a new process has been spawned to execute the job in background. NB: at that stage we don't know yet if the job has been properly executed.cron.log
will tell you which jobs have been actually executed.So if you read Job1 [async]
and Job1
doesn't appear in cron.log
, that means its execution failed for some reason.
To check if the job alone runs OK, just call it directly either with GET /cron/Job1
or php index.php /cron/Job1
. This will execute it synchronously, no matter if it's due or not.
NB: cron.log
belongs to LOGS (not TEMP). It was a mistake in the docs. I just fixed it.
Ok, I get it.
It makes sense that an async job can't output something directly.
I just needed to enable PHP logs for the CLI mode, now I can debug with my logs :)
And now I can see the cron.log file, which is not in the TEMP folder like you said, but in the LOGS folder.
Merci bien l'ami !
De rien. N'hésite pas si tu as d'autres questions.
Hi
Is there a way to display the output of the functions triggered by f3-cron ?
I use
silent=false
, but the only thing that it outputs isnameOfTheJob [async]
My function works well when called via HTTP, but it doesn't when called via CLI. I would like to have some error in the output, instead of just the name of the job.
I also use
log=true
but the cron.log file is not created in the TEMP folder.Thanx