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

How do I log username in access log? #230

Closed
nabheet opened this issue May 13, 2024 · 1 comment
Closed

How do I log username in access log? #230

nabheet opened this issue May 13, 2024 · 1 comment

Comments

@nabheet
Copy link

nabheet commented May 13, 2024

I have a Fast API application that uses Bearer tokens. Is there was way for me to provide hypercorn the username or some identifier of the user/service-account associated with the bearer token from Fast API? So that it can be logged in the access log.

EDIT 1: I just realized I could set a response header in fast api and have hypercorn log it in the access log. Is that the best way to accomplish this?

@pgjones
Copy link
Owner

pgjones commented May 26, 2024

I think the response header would work. Although it might make more sense to access log in FastAPI rather than Hypercorn - there is a good discussion of options here

@pgjones pgjones closed this as completed May 26, 2024
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

No branches or pull requests

2 participants