0

I'm having trouble configuring logging in .NET Core 3.1 to write to both console and a file simultaneously. Specifically, I want to log messages to the console for real-time monitoring, and also write the same messages to a file for later analysis. Currently, I am only able to log messages to one destination at a time, either the console or the file. I need a solution that allows me to write to both destinations at the same time.

I have tried configuring the logging in my .NET Core 3.1 application using the built-in logging framework and using third-party logging libraries like Serilog. My expectation was that I would be able to write log messages to both console and a file using a single configuration, but I was not successful. When I configured logging to write to console, it would not write to the file, and when I configured it to write to a file, it would not log to the console.

0 Answers0