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

Respect celery log level in structlog config / try to clean up a bit #46999

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dstandish
Copy link
Contributor

This area of code is quite confusing and hard to follow. I try to make it a little bit easier to follow by breaking up some of the functions into smaller ones. In some cases this clarifies the logic a little bit. I did not intend any behavior changes in the refactor portion of this.

The one behavior change I did intend was in the celery_command file, where I pass the log level to configure_logging so that you don't have debug logs on by default when using structlog.

There's a lot here that I still don't really understand and which remains confusing but I accomplished my main goal here so moving on for now.

This area of code is quite confusing and hard to follow.  I try to make it a *little* bit easier to follow by breaking up some of the functions into smaller ones.  In some cases this clarifies the logic a little bit. I did not intend any behavior changes in the refactor portion of this.

The one behavior change I did intend was in the celery_command file, where I pass the log level to `configure_logging` so that you don't have debug logs on by default when using structlog.

There's a lot here that I still don't really understand and which remains confusing but I accomplished my main goal here so moving on for now.
if AIRFLOW_V_3_0_PLUS:
from airflow.sdk.log import configure_logging

configure_logging(output=sys.stdout.buffer)
configure_logging(output=sys.stdout.buffer, log_level=celery_log_level)
Copy link
Member

@jedcunningham jedcunningham Feb 23, 2025

Choose a reason for hiding this comment

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

Hmm, celery_log_level used to just change the logging level in celery itself, right? Does this impact the Airflow side now too?



@cache
def logging_processors_ugly():
Copy link
Member

Choose a reason for hiding this comment

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

Maybe plain instead?

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

Successfully merging this pull request may close these issues.

2 participants