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

前端 未结 8 1124
北海茫月
北海茫月 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 09:51

    If you are using IIS, you can enable and view stdout logs:

    1. Edit the web.config file.
    2. Set stdoutLogEnabled to true.
    3. Change the stdoutLogFile path to point to the logs folder (for example, .\logs\stdout).
    4. Save the file.
    5. Make a request to the app.
    6. Navigate to the logs folder. Find and open the most recent stdout log.

    For information about stdout logging, see Troubleshoot ASP.NET Core on IIS.

提交回复
热议问题