Currently doing a project in .NET CORE, where i am going to have various layers, including a CrossCuting layer, but i cant get my head around this problem...
right now i have a Logger working all fine, using Serilog. But my problem now is, i want to Have my logger created and configured inside the CrossCutting layer, and then injected into the Application layer(for now).
Is There any possible way to do that? So many articles explaining how to do the configuration trough Program.cs
but what about inside a Layer?
Asked
Active
Viewed 183 times
0

filipe
- 139
- 2
- 17
1 Answers
0
In order to correlate logs that belong to the same request, even across multiple applications, add a CorrelationId property to your logs.
Here you have Serilog best practices: https://benfoster.io/blog/serilog-best-practices/

Facundo
- 39
- 1
- 3