Skip to content

Cannot deactivate File-based logs for at processor #70968

Open

Description

@alkismavridis

Under which category would you file this issue?

Airflow Core

Apache Airflow version

3.3.0

What happened and how to reproduce it?

Goal

Completely disable file-based logs from dag processor.

Context

I Run airflow. I Notice that dag_processor creates many logs under /opt/airflow/logs/dag_processor. In fact, this directory eventually grows multiple GBs large and eats all available space.

I can create some log rotator / archiver, but in fact I do not need the dag_processor logs at all so I would very much prefer to deactivate them completely.

What I tried

  1. Setting [logging] --> dag_processor_log_target = stdout and restarted airflow. Intuitively I would expect that this would work, but unfortunately the directory still being created and filled with multiple MBs per day.

A sample from the files I see:

{"timestamp":"2026-08-03T00:23:28.159066Z","level":"info","event":"Filling up the DagBag from /opt/airflow/dags/purchases/purchases_batch_prices_sync.py","dag_file":"purchases/purchases_batch_prices_sync.py","bundle_name":"dags-folder","logger":"airflow.dag_processing.dagbag.BundleDagBag","filename":"dagbag.py","lineno":460}
{"timestamp":"2026-08-03T00:23:28.163495Z","level":"warning","event":"The airflow.security.permissions module is deprecated; please see https://airflow.apache.org/docs/apache-airflow/stable/security/deprecated_permissions.html","dag_file":"purchases/purchases_batch_prices_sync.py","bundle_name":"dags-folder","category":"UserWarning","filename":"<attrs generated methods airflow.sdk.definitions.dag.DAG>","lineno":96,"logger":"py.warnings"}
{"timestamp":"2026-08-03T00:23:58.281367Z","level":"info","event":"Filling up the DagBag from /opt/airflow/dags/purchases/purchases_batch_prices_sync.py","dag_file":"purchases/purchases_batch_prices_sync.py","bundle_name":"dags-folder","logger":"airflow.dag_processing.dagbag.BundleDagBag","filename":"dagbag.py","lineno":460}
{"timestamp":"2026-08-03T00:23:58.286175Z","level":"warning","event":"The airflow.security.permissions module is deprecated; please see https://airflow.apache.org/docs/apache-airflow/stable/security/deprecated_permissions.html","dag_file":"purchases/purchases_batch_prices_sync.py","bundle_name":"dags-folder","category":"UserWarning","filename":"<attrs generated methods airflow.sdk.definitions.dag.DAG>","lineno":96,"logger":"py.warnings"}
{"timestamp":"2026-08-03T00:24:28.471662Z","level":"info","event":"Filling up the DagBag from /opt/airflow/dags/purchases/purchases_batch_prices_sync.py","dag_file":"purchases/purchases_batch_prices_sync.py","bundle_name":"dags-folder","logger":"airflow.dag_processing.dagbag.BundleDagBag","filename":"dagbag.py","lineno":460}
{"timestamp":"2026-08-03T00:24:28.475547Z","level":"warning","event":"The airflow.security.permissions module is deprecated; please see https://airflow.apache.org/docs/apache-airflow/stable/security/deprecated_permissions.html","dag_file":"purchases/purchases_batch_prices_sync.py","bundle_name":"dags-folder","category":"UserWarning","filename":"<attrs generated methods airflow.sdk.definitions.dag.DAG>","lineno":96,"logger":"py.warnings"}
{"timestamp":"2026-08-03T00:24:59.339487Z","level":"info","event":"Filling up the DagBag from /opt/airflow/dags/purchases/purchases_batch_prices_sync.py","dag_file":"purchases/purchases_batch_prices_sync.py","bundle_name":"dags-folder","logger":"airflow.dag_processing.dagbag.BundleDagBag","filename":"dagbag.py","lineno":460}
{"timestamp":"2026-08-03T00:24:59.343819Z","level":"warning","event":"The airflow.security.permissions module is deprecated; please see https://airflow.apache.org/docs/apache-airflow/stable/security/deprecated_permissions.html","dag_file":"purchases/purchases_batch_prices_sync.py","bundle_name":"dags-folder","category":"UserWarning","filename":"<attrs generated methods airflow.sdk.definitions.dag.DAG>","lineno":96,"logger":"py.warnings"}

What you think should happen instead?

Setting dag_processor_log_target = stdoutshould meain no logs written to the file system

Operating System

docker container

Deployment

Docker-Compose

Apache Airflow Provider(s)

No response

Versions of Apache Airflow Providers

No response

Official Helm Chart version

Not Applicable

Kubernetes Version

No response

Helm Chart configuration

No response

Docker Image customizations

Only mounting some volumes (/opt/airflow/logs/ being one of them) and pip installing "apache-airflow-providers-oracle"

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Aug 3, 2026
  2. takayoshi-makabe commented on Aug 3, 2026

    @takayoshi-makabe
    Contributor

    dag_processor_log_target was originally added in 2.4.0 (#25754) as a genuine exclusive switch: the airflow.processor logger's Python logging handler was swapped between a file handler and a stdout handler, so setting it to stdout meant no file was ever created.

    When the Dag File Processor was rewritten onto the Task SDK's subprocess/structlog architecture (around 3.0/3.1), that handler-swap mechanism was dropped entirely, and the config option silently stopped doing anything.

    #65528 (merged 2026-04-20) reconnected the option, but wired it into the subprocess_logs_to_stdout flag that already existed for task logs. That flag is intentionally additive for task logs — it duplicates output to stdout while always keeping the file, which makes sense there because task logs are served via the Log API and can be uploaded to remote storage, so the file is load-bearing.

    Dag processor logs have neither of those dependencies (no API/UI route serves them, and they're never uploaded to remote storage), so there's no structural reason to force a file write when dag_processor_log_target = stdout. The current behavior (always write the file, optionally also duplicate to stdout) matches what #65528 intended for containers, but doesn't restore the original exclusive semantics that the config's own docs still describe ("Where to send dag parser logs. If 'file', logs are sent to log files...").


    Drafted-by: Claude Code (Sonnet 5); reviewed by @takayoshi-makabe before posting

  3. takayoshi-makabe commented on Aug 3, 2026

    @takayoshi-makabe
    Contributor

    A couple of other options, since #65528 was a recent maintainer decision that some users may already rely on:

    • Docs-only: update the config docs to match the current additive behavior.
    • New option/value: keep stdout as-is, and add something like stdout_only for users who want to skip the file write.
  4. alkismavridis commented on Aug 3, 2026

    @alkismavridis
    ContributorAuthor

    The ability to deactivate file-based logs would be highly appreciated 🙏
    Especially for those who run airflow inside docker containers, stdout is absolutely enough since our underlying docker infrastructure already deals with rotations, archivings etc. And as far as I understand it, other airflow components such as the triggerer or scheduler do not create file logs, so the dag processor seems to behave differently here. Please correct me if I am wrong on that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:loggingkind:bugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions