Skip to content

Change_log_level #187

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

GSmithApps
Copy link
Contributor

@GSmithApps GSmithApps commented May 23, 2025

What was changed

Added a hello sample showing how to change the log level for workflow task failures

Why?

Some users have requested a sample on this.

Checklist

  1. Any docs updates needed?
    Updated the top-level readme and the hello readme

  2. How was this tested:
    Ran and confirmed that the log level was changed to error

image

@GSmithApps GSmithApps requested a review from a team as a code owner May 23, 2025 17:46
@GSmithApps GSmithApps force-pushed the changle_log_level branch from 5cfa4c5 to 598c1af Compare May 23, 2025 17:48
return True


logging.getLogger("temporalio.worker._workflow_instance").addFilter(CustomLogFilter())
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
logging.getLogger("temporalio.worker._workflow_instance").addFilter(CustomLogFilter())
logging.getLogger().addFilter(CustomLogFilter())

Can we add this to the root logger instead (untested)? There are no guarantees about how we may refactor internals.

Copy link
Member

Choose a reason for hiding this comment

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

May be able to add a test for this to confirm continued expected behavior (though I know we haven't always added tests for all samples)

@GSmithApps GSmithApps changed the title Changle_log_level Change_log_level Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants