'Logging in .NET Core and ASP.NET Core
I want to log certain output in .net core webapi to a .txt file.
The Microsoft documentation says https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-6.0&WT.mc_id=DT-MVP-5002040#console
Call WebApplication.CreateBuilder, which adds the following logging providers:
Console
Debug
EventSource
EventLog: Windows only
There is no information on how to write to a .log file or a .txt file. It all says about console, debug and eventlog.
Am I missing something?
Solution 1:[1]
Please have a lookt at this post Where does the log file get written to in .Net Core Logging. This should answer your question.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | frank |
