How to log to a file without using third party logger in .Net Core?

前端 未结 8 1295
北海茫月
北海茫月 2020-12-25 09:22

How to log to a file without using third party logger (serilog, elmah etc.) in .NET CORE?

public void ConfigureSer         


        
8条回答
  •  不思量自难忘°
    2020-12-25 10:07

    Since .Net core (2.2) does not implement this yet, still, we have to use a third party plugin for this.

    If you want to log Error, Warning and etc into a txt file in a .Net Core API project. You can use what I used on my project which is called Serilog.

    and you can follow the below blog to configure Serilog on your project.

    http://anthonygiretti.com/2018/11/19/common-features-in-asp-net-core-2-1-webapi-logging/

提交回复
热议问题