-
Notifications
You must be signed in to change notification settings - Fork 825
Open
Labels
area-telemetrybugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.untriaged
Description
Description
It seems like the AddExtendedHttpClientLogging
is able to log the http request and response bodies, headers and the path....but not query string parameters. this seems like an oversight....or am i missing something?
Reproduction Steps
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Compliance.Redaction;
using Microsoft.Extensions.Http.Diagnostics;
var builder = WebApplication.CreateBuilder(args);
builder.Logging.AddJsonConsole();
builder.Services.AddSingleton<IRedactorProvider, NullRedactorProvider>();
builder.Services.AddExtendedHttpClientLogging(options =>
{
#pragma warning disable EXTEXP0003
options.LogContentHeaders = true;
options.RequestBodyContentTypes.Add("application/json");
options.ResponseBodyContentTypes.Add("application/json");
options.LogBody = true;
options.RequestPathParameterRedactionMode = HttpRouteParameterRedactionMode.None;
});
var app = builder.Build();
app.MapGet("/", ([FromServices] HttpClient http) => http.GetStringAsync("https://jsonplaceholder.typicode.com/todos/1?query=value"));
app.Run();
Expected behavior
the output to include the query string parameters
Actual behavior
{
"EventId": 1,
"LogLevel": "Information",
"Category": "Microsoft.Extensions.Http.Logging.HttpClientLogger",
"Message": "GET jsonplaceholder.typicode.com//todos/1",
"State": {
"Message": "http.request.method=GET,server.address=jsonplaceholder.typicode.com,url.path=/todos/1,Duration=886,http.response.status_code=200,RequestBody=,ResponseBody={\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n}",
"http.request.method": "GET",
"server.address": "jsonplaceholder.typicode.com",
"url.path": "/todos/1",
"Duration": 886,
"http.response.status_code": 200,
"RequestBody": "",
"ResponseBody": "{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n}"
}
}
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
area-telemetrybugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.untriaged