Create Your Own Logging Provider to Log to Text Files in .NET Core

preview_player
Показать описание
💻 Download the code example for this demo 💻

When Logging in .NET Core, you can configure what you log depending on the logging provider.

The logging provider can range from the console to the event log. Or, it might even be a third-party like Serilog.

We will walk through the basics of logging in .NET Core and set up some logs in an ASP.NET Core API application.

Afterwards, we will then go ahead and create our own logging provider. This logging provider will be used so we can output our logs to text files.

📖 Learn .NET and C# with our online courses 📖

Рекомендации по теме
Комментарии
Автор

Great video, just a suggestion for the viewers: please increase the real estate of your code windows. It's very hard to follow what you're doing in a 145% zoomed in 500x300 px window ^^

CreativeBST
Автор

Probably the only video that shows how to create LP to Log to Text Files in .Net Core! Well done! I am looking to implement for a Blazor Server app : how could I implement ".ConfigureLogging((hostBuilderContext, logging) =>..." as I am doing it with Console here: var builder = builder.Logging.AdConsole();? Thank you!

carlselrahc
Автор

Thank you for your video, I learned a lot!

KeoghJenkins
Автор

Great video, thanks for sharing, please keep up!

avisiboni
Автор

good info, In the future make your work window larger, no need to program through a keyhole. it very hard to understand new concepts reading a partial line of code

stevestrong
Автор

I only got through four minutes of this video and I had to stop because of the difficulty in reading the very large code window that has excessive horizontal scrolling. I hope I can find another YouTube provider with similar content.

LesGainous
Автор

Great, Great Video!!! Do you perhaps have a video on logging into a sql database Or maybe advise on what to change if I want to log into a sql database instead of a file

christianmukeba
Автор

Very good video. Please close solution explorer in your next videos

lugmonxojapardayev
Автор

OMG! Please maximize your edit window. This is crazy.

responsibleparty
Автор

Great, thanks for posting, can you please also make video how to log the log information in sql databse instead of text file.

ImperfectlyComplete
Автор

protected fields in controller?? why ?

orhanaliyev
Автор

Really helpful. Thanks for sharing. can we able to access the Request headers keyvalues in Filelogger.cs --> Log<Tstate> method (to print the header values in logRecord variable)

GANESH-KUMAR
Автор

Will not the code become cluttered or messy over time as the log line increases? Is there a possibility or any known example that you can share to create a common library for logging logic? Thank you.

binoykanchanwala
Автор

awesome video content but its quite difficult to follow when we can only see 5 characters per line

richardprakash
Автор

Very interesting. But I followed the example in .Net 6 and did something wrong with setting up program.cs. Any advice welcomed as the example in the video does not see to work.

geoffreywadsworth
Автор

LogLevel for specific provider (i.e Console) overrides the non-specific provider.

jessegador
Автор

I'm not able to get AddRoundTheCodeFileLogger in .ConfigureLogging() in program.cs file

nithinshub