Hi Jonas,
If the task is not run then the log won't be generated - as the file is generated by Airflow worker and if task is not run then, by definition, Airflow worker is not able to create a log.
The most important thing in your case, I think, it's to determine why a task is not run - there might be a couple of reasons.
1. If the task sits in the Task Queue for too long (in case of Composer 1/Airflow 1 it is 10 minutes) then the Scheduler is going to cancel this task and in such a case a task log won't be generated.
and the task will be rescheduled once again.
2. If, because of any reason, Scheduler scheduled a task and Worker doesn't have access to DAG file then such a task won't be executed and again in such a case a task log won't be generated.
Regards, Rafal.