Skip to content

logging: add requestID for access logs, application logs and traceback logs#1064

Open
boddumanohar wants to merge 1 commit into
mainfrom
logs-add-requestid
Open

logging: add requestID for access logs, application logs and traceback logs#1064
boddumanohar wants to merge 1 commit into
mainfrom
logs-add-requestid

Conversation

@boddumanohar
Copy link
Copy Markdown
Member

@boddumanohar boddumanohar commented May 26, 2026

currently in the WebApp API we have see 3 types of logs:

  1. Access logs --> ex: POST /cluster/<uid>.. 20ms "Go client
  2. Application logs --> ERROR: failed to clone volume
  3. Traceback logs --> Traceback: ...

To allow us to connect all these 3 together, have added a new field request_id to the logging filter.

So at the start of the request, within the middleware, we inject the request_id

token = core_utils.request_id_var.set(request_id)

and then reset it after the request ends

core_utils.request_id_var.reset(token)

But since the update has been to the core logger, simplyblock_core/utils/__init__.py for CLI, output, we'll see the extra [-] in between.

testing

TODO

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.

1 participant