microsoft / AzureTipsAndTricks

Learn some of our favorite Azure tips and tricks—some long-standing, and new ones that have recently been added to become more productive with Azure. Star the repo now to shave hours off your coding tasks tomorrow.
http://azuredev.tips
Creative Commons Attribution 4.0 International
1.49k stars 489 forks source link

Misleading note on how to log to Log Stream #128

Closed Coder3333 closed 3 years ago

Coder3333 commented 3 years ago

Tip 30 (https://microsoft.github.io/AzureTipsAndTricks/blog/tip30.html) states that when you call Trace.WriteLine from an ASP.Net MVC application, the text will appear in the Log Stream. This is true from an ASP.Net MVC application, but not ASP.Net Core. From an ASP.Net Core application, writing to Trace.WriteLine does not direct to the Log Stream. The only thing I have found that will write to Log Stream from ASP.Net Core in a Windows container is by writing to ILogger. Oddly, Trace.WriteLine does direct to the Log Stream from Linux containers.

I am requesting that the documentation reflect these nuances.

vaheminasyan2 commented 3 years ago

Hi @cecilphillip, could you please take a look at this question for tip 30? Thank you.

cecilphillip commented 3 years ago

Hey @mbcrump, do you know who would be responsible for updating this?

mbcrump commented 3 years ago

Hey @coder333,

This article was meant for ASP.NET MVC, not core. It doesn't state anywhere in the article it is for core.

What could be helpful is to add a note at the top mentioning that this article is for ASP.NET MVC (targeting the .NET Framework). // @vaheminasyan2

Thanks for the feedback!

MC

vaheminasyan2 commented 3 years ago

Thank you @mbcrump for taking a quick look at this. I updated the tip to include your note.