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

Prevent logging of requests that are blocked by middlewares #3135

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

Conversation

tsu-ki
Copy link
Contributor

@tsu-ki tsu-ki commented Dec 19, 2024

Closes: #3133

@tsu-ki tsu-ki marked this pull request as ready for review December 19, 2024 19:48
@DonnieBLT DonnieBLT requested a review from Copilot December 20, 2024 14:54

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

Copy link
Collaborator

@DonnieBLT DonnieBLT left a comment

Choose a reason for hiding this comment

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

Can this be done without another middleware file?

@tsu-ki
Copy link
Contributor Author

tsu-ki commented Dec 21, 2024

Can this be done without another middleware file?

@DonnieBLT Sir, Initially I tried to define the class in ip_restrict.py file but due to circular import error during app registry initialization, I was getting this:
Since the app registry isn't fully loaded during the logging configuration phase, this results in the AppRegistryNotReady exception.
So, to decouple the logging filter during initialization, I created a seperate filter module which doesn't cause the circular dependency problem.

@tsu-ki tsu-ki requested a review from DonnieBLT December 23, 2024 19:12
@tsu-ki
Copy link
Contributor Author

tsu-ki commented Jan 2, 2025

@DonnieBLT sir, can you please review this PR and merge it, if there's no other changes to be made. thank you!

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.

For requests that are blocked by middleware, do not log them.
2 participants