saleem-mirza/serilog-sinks-azure-analytics

.NET 5 Seems to Not Work

Opened this issue · 2 comments

Describe the bug
Implemented everything as described but no logs can be found in the portal.

To Reproduce
Steps to reproduce the behavior:

  1. Create a .NET 5 MVC Web App
  2. Add the necessary Nuget Packages
  3. Change program.cs as instructed

Run the app and you can see the new custom log but no entries are being written.

Expected behavior
I'm expecting .NET 5 to work just like .NET Core 3.1 should work.

hello 👋 - did you ever get to the bottom of this & get it working?

FYI, I was building a .NET 6 app & I missed builder.Host.UseSerilog(); // <-- Add this line from the Serilog setup guide & that fixed my issue (plus the CloseOnFlush via try/finally).