msgraph-sdk-python icon indicating copy to clipboard operation
msgraph-sdk-python copied to clipboard

Excessive Informational Logs from Library During HTTP Requests

Open Marcuccio opened this issue 10 months ago • 0 comments

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

Marcuccio avatar Mar 04 '25 11:03 Marcuccio