saleem-mirza / serilog-sinks-azure-analytics

Serilog sink which writes to Azure analytics
Apache License 2.0
62 stars 45 forks source link

.NET 5 Seems to Not Work #65

Open kenneymyers opened 3 years ago

kenneymyers commented 3 years ago

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.

spottedmahn commented 1 year ago

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

spottedmahn commented 1 year ago

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).