I got a microservice .NET Core that receives a Serilog.Events.LogEvent though a external source. The Microservice implements the UseSerilog whitch mean that the injected Microsoft ILogger will be a disguised Serilog.
The question is how I log my LogEvent from within this class that only got a Microsoft ILogger?
I tried to cast the Microsoft ILogger to a Serilog ILogger but that was not possible.
MS Ilogger is supposed to make it easy to switch logging systems, all a class needs to know about should be the MS Ilogger. But in this case, I took a shortcut, I simple injected a Serilog ILogger and then used this to log the LogEvent.
This is a very small standalone project so it should not be a problem. Besides, to get Serilog structure logging working one must use a specific syntax, this might not be the same if the log system is changed.