Last week I wrote about .NET Core and Microsoft Bot Framework and I’m still learning and playing with it. The thing is that once I implemented more features and deployed the bot to Azure it didn’t work. So I had to find a way to log and trace what was happening in order to diagnose and fix the problem.

This time I decided to give a chance to Serilog and as you should know by now, getting the correct dependencies to work with .Net Core is not always easy, so here is my Step by step: Serilog with ASP.NET Core

1. Add the following dependencies in your project.json file
2. Add the following lines to the constructor of your Startup class
3. Add the following line to the configure method of your Startup class
4. Inject the logger to your services or controllers

Hope it helps!

4 thoughts on “Step by step: Serilog with ASP.NET Core

Leave a Reply

Your email address will not be published. Required fields are marked *