ecs-dotnet icon indicating copy to clipboard operation
ecs-dotnet copied to clipboard

Query string is not included in the logs

Open mjirhage opened this issue 3 years ago • 0 comments

ECS version: 1.5.0

Elastic.CommonSchema.Serilog version: 1.5.3

.NET framework / OS: ASP.NET Core 6

Description of the problem, including expected versus actual behavior:

The query string is not logged in the url field of the log.

In Elastic.CommonSchema.Serilog.HttpAdapter.ConvertToUri() an instance of an Uri is created from the HttpRequest:

new Uri($"{request.Scheme}://{request.Host}{request.Path}");

The query string in the request is not included so Uri.Query will be null.

Therefore the url returned from the propery Url will not have the Query property set.

Steps to reproduce:

  1. Call an endpoint with query parameters.

mjirhage avatar Aug 18 '22 13:08 mjirhage