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

request id not found in request access log middleware error #3

Open
yajneshp opened this issue Sep 8, 2020 · 0 comments
Open

request id not found in request access log middleware error #3

yajneshp opened this issue Sep 8, 2020 · 0 comments

Comments

@yajneshp
Copy link

yajneshp commented Sep 8, 2020

Application is failing with request_id is not found in request. I can see the request_id is getting added as part of the RequestIDMiddleware but it is not getting retained in the AccessLogMiddleware.

 logger = logging.getLogger(self.log_name)
        logger = logging.LoggerAdapter(logger, dict(
            request_id=request.request_id,
            time_cost=stats.time,
            request_method=request.method,
            request_path=request.base_url.path,
            response_code=response.status_code
        ))
        logger.info("")

if I replace request.state.request_id is works fine.

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

1 participant