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

Convert Access Log Generator to use Python logging #473

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

Conversation

mbidewell
Copy link

Commits to move forward #116. Convert the access log to use the python logging framework. Also pass data as named components to make it easier for JSON formatting

@sikmir
Copy link

sikmir commented Dec 4, 2024

Any update?

@carltongibson
Copy link
Member

@sikmir Needs a rebase and a review, but looks along the right lines.

@mbidewell mbidewell force-pushed the access-logging-handler branch from f7e1f21 to c741811 Compare December 30, 2024 03:26
@mbidewell
Copy link
Author

Sorry got busy and missed this. branch should be rebased

Copy link
Collaborator

@bigfootjon bigfootjon left a comment

Choose a reason for hiding this comment

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

Just one question, otherwise this lgtm

daphne/access.py Outdated
Comment on lines 23 to 24
else:
logger.addHandler(logging.NullHandler)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not super familiar with how the logging module works, but why are these lines needed? What happens if they are removed?

Copy link
Author

Choose a reason for hiding this comment

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

My understanding is that the access log would be written to the default handler (likely console). If I am understanding the cli correctly, the access log is not written unless explicitly enabled,

Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we just set propagate = False unconditionally then? (I totally might be misunderstanding how this all works, please bear with me)

Copy link
Author

Choose a reason for hiding this comment

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

I'll need to dig in after I recreate a testing environment. Looks like some other tweaks may be needed

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.

4 participants