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

Deployed logging no longer has request details #169

Closed
jwhitlock opened this issue Apr 29, 2021 · 1 comment · Fixed by #203
Closed

Deployed logging no longer has request details #169

jwhitlock opened this issue Apr 29, 2021 · 1 comment · Fixed by #203

Comments

@jwhitlock
Copy link
Contributor

After switching to gunicorn, the logging in stage and production is still in MozLog format, but only has the raw message as the Fields body. Determine how to do detailed logging with gunicorn.

@jwhitlock
Copy link
Contributor Author

I don't think the existing logging is going to work with gunicorn.

The uvicorn dev logger relies on the additional context, including the request object, that is passed to the logger when run under uvicorn. The uvicorn loggers are much simpler when run as a worker under gunicorn, presumably because gunicorn pre-processes the request.

I think I'll need to return to my original plan (issue #106) to use structlog and have an application-specific logger. In dev, I'll make the uvicorn.access log quiet and emit the application log, and in production the application log will be in MozLog format. This is a bit of rework, but it will more smoothly transition to a logger for background processes.

I'm going to switch to metrics before tackling logs again.

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 a pull request may close this issue.

1 participant