Skip to content

Make the "Toggle Source" log display only hide source fields, not all fields#55474

Merged
ashb merged 1 commit intoapache:mainfrom
astronomer:log-toggle-source-keep-other-struct-fields
Sep 10, 2025
Merged

Make the "Toggle Source" log display only hide source fields, not all fields#55474
ashb merged 1 commit intoapache:mainfrom
astronomer:log-toggle-source-keep-other-struct-fields

Conversation

@ashb
Copy link
Copy Markdown
Member

@ashb ashb commented Sep 10, 2025

With the move to structured logging wholesale in #52651, we are going to start
seeing a lot more structured log key/values other than just logger and
chan -- so "Toggle Source" now just hides those specific fields.

It also changes the format/display to cope better with more than one KV being shown
in the logs.

Before, with Source
Screenshot 2025-09-10 at 18 41 38

Before, without Source

Screenshot 2025-09-10 at 18 41 44

After, with Source
Screenshot 2025-09-10 at 18 41 03

After, without Source
Screenshot 2025-09-10 at 18 41 10

Note the filename= and lineno= in a few places -- those are other key/value pairs from log lines like this (that I am working on as part of another change:

{
    "timestamp":"2025-09-10T15:44:46.734893",
    "level":"info",
    "event":"Done. Returned value was: None",
    "logger":"airflow.task.operators.airflow.providers.standard.operators.python.PythonOperator", 
    "filename":"python.py",
    "lineno":218
}

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@ashb ashb added this to the Airflow 3.1.0 milestone Sep 10, 2025
@ashb ashb added the kind:bug This is a clearly a bug label Sep 10, 2025
@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Sep 10, 2025
@ashb ashb requested a review from kaxil September 10, 2025 17:46
Copy link
Copy Markdown
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Just nit in test to be fixed. Else I liek very much!

… fields

With the move to structured logging wholesale in apache#52651, we are going to start
seeing a lot more structured log key/values other than just `logger` and
`chan` -- so "Toggle Source" now just hides those specific fields.

It also changes the format/display to cope better with more than one KV being shown
in the logs.
@ashb ashb force-pushed the log-toggle-source-keep-other-struct-fields branch from cc3416e to 73bbe12 Compare September 10, 2025 21:10
Copy link
Copy Markdown
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@ashb ashb merged commit 224b50c into apache:main Sep 10, 2025
55 checks passed
@ashb ashb deleted the log-toggle-source-keep-other-struct-fields branch September 10, 2025 22:00
kaxil pushed a commit to astronomer/airflow that referenced this pull request Sep 11, 2025
suman-himanshu pushed a commit to suman-himanshu/airflow that referenced this pull request Sep 17, 2025
Brunda10 pushed a commit to Brunda10/airflow that referenced this pull request Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants