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

Redirect CommandLineTool output to default task log file #61

Open
francescobianco opened this issue Jun 18, 2021 · 1 comment
Open

Redirect CommandLineTool output to default task log file #61

francescobianco opened this issue Jun 18, 2021 · 1 comment
Labels

Comments

@francescobianco
Copy link

I want collect all generated output by every task into standard Airflow task log file, generally is ./logs/{dag_id}/{task_id}/{run_stamp}/1.log

Furthermore I would get all logs for every task into single file, I want collapse all log into file 1.log and not into 1.log.cwl

Screenshot from 2021-06-18 03-24-25

@michael-kotliar
Copy link
Member

Hi @francescobianco
Sure, it's easy to do. I intentionally patch airflow.cfg to split the logs into two files to keep airflow and cwl logs separately. You can see how I do it here

["sed", "-i", "-e", "s#^logging_config_class.*#logging_config_class = cwl_airflow.config_templates.airflow_local_settings.DEFAULT_LOGGING_CONFIG#g", args.config],

If you want to to keep both of the logs in the same file, set the default value for logging_config_class in airflow.cfg.

Let me know if you have any other questions.

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

No branches or pull requests

2 participants