I have an ASP.NET 5 Web API that I host in Azure as a Web App. I want to log messages from my code using Azure Diagnostics. There are multiple article including Azure docs that
If you look at your web.config
, it probably has stdoutLogEnabled="false"
. If you set that to true, then anything that is written to standard output will be written to a file. And the stdoutLogFile
determines where it goes, which by default is under d:\home\logfiles
.
Now you need to make sure that your logging actually goes to stdout. Doing Console.WriteLine
would definitely work. I think it's probably possible to also configure things via ILoggerFactory
in your startup.cs
to make logs go to stdout.