microsoftgraph / microsoftgraph/msgraph-sdk-python

Excessive Informational Logs from Library During HTTP Requests

Open
#1,130 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
630
Forks
96
Avg merge
15h 20m
Merged PRs (30d)
3

Description

I am using the library as shown below and I am flooded from logs coming from the library:

2025-02-11 17:17:37,072 - INFO - HTTP Request: GET https://graph.microsoft.com/v1.0//users/REDACTED "HTTP/2 200 OK"
2025-02-11 17:17:37,119 - INFO - ClientSecretCredential.get_token succeeded
2025-02-11 17:17:37,199 - INFO - HTTP Request: GET https://graph.microsoft.com/v1.0//users/REDACTED "HTTP/2 200 OK"
2025-02-11 17:17:37,249 - INFO - ClientSecretCredential.get_token succeeded
2025-02-11 17:17:37,330 - INFO - HTTP Request: GET https://graph.microsoft.com/v1.0//users/REDACTED "HTTP/2 200 OK"
2025-02-11 17:17:37,391 - INFO - ClientSecretCredential.get_token succeeded
2025-02-11 17:17:37,470 - INFO - HTTP Request: GET https://graph.microsoft.com/v1.0//users/REDACTED "HTTP/2 200 OK"
2025-02-11 17:17:37,516 - INFO - ClientSecretCredential.get_token succeeded
2025-02-11 17:17:37,591 - INFO - HTTP Request: GET https://graph.microsoft.com/v1.0//users/REDACTED "HTTP/2 200 OK"
2025-02-11 17:17:37,641 - INFO - ClientSecretCredential.get_token succeeded

How do I make it stop?

async def find_user(client: GraphServiceClient, user_id: str) -> None:

    query_params = UserItemRequestBuilder.UserItemRequestBuilderGetQueryParameters(
		expand = ["manager($levels=max;$select=id,displayName,mail,department,jobTitle)"],
		select = ["customSecurityAttributes","id","displayName","mail","department","jobTitle"],
    )

    request_configuration = RequestConfiguration(
        query_parameters = query_params,
    )

    return await client.users.by_user_id(user_id).get(request_configuration = request_configuration)

Originally posted by @Marcuccio in https://github.com/microsoftgraph/msgraph-sdk-python/discussions/1112

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided find_user entry point and reproduce the repeated informational output using GraphServiceClient and the shown request configuration. Trace which library component emits the HTTP and credential messages; done means the request still works without the excessive informational logs, with behavior covered by an appropriate regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.