How do I write logs from within Startup.cs?
Asked 07 September, 2021
Viewed 811 times
  • 57
Votes

In order to debug a .NET Core app which is failing on startup, I would like to write logs from within the startup.cs file. I have logging setup within the file that can be used in the rest of the app outside the startup.cs file, but not sure how to write logs from within the startup.cs file itself.

12 Answer