Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Correlation Id is not getting printed #94

Open
DevOnRun opened this issue Feb 2, 2023 · 1 comment
Open

Correlation Id is not getting printed #94

DevOnRun opened this issue Feb 2, 2023 · 1 comment

Comments

@DevOnRun
Copy link

DevOnRun commented Feb 2, 2023

.Net version: 6.0

Dependency packages
Serilog version: 2.10.0
Serilog.AspNetCore version: 6.1.0

Sample log printed:
{"@t":"2023-02-02T13:05:26.3628967Z","@m":"Request finished HTTP/1.1 GET http://localhost:5099/api/v1/LocationWeather - - - 404 - appliction/json 1516.1679ms","@i":"791a596a","ElapsedMilliseconds":1516.1679,"StatusCode":404,"ContentType":"appliction/json","ContentLength":null,"Protocol":"HTTP/1.1","Method":"GET","Scheme":"http","Host":"localhost:5099","PathBase":"","Path":"/api/v1/LocationWeather","QueryString":"","HostingRequestFinishedLog":"Request finished HTTP/1.1 GET http://localhost:5099/api/v1/LocationWeather - - - 404 - appliction/json 1516.1679ms","EventId":{"Id":2},"SourceContext":"Microsoft.AspNetCore.Hosting.Diagnostics","RequestId":"0HMO53O3VJI4V:00000005","RequestPath":"/api/v1/LocationWeather","ConnectionId":"0HMO53O3VJI4V","MachineName":"DESKTOP-xxxxx","ServiceName":"Test.LocationWeatherService","ServiceVersion":"1.0.0.0"}

@NotIlya4
Copy link

NotIlya4 commented May 5, 2023

You need this to make it work: builder.Services.AddHttpContextAccessor();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants