I have a ASP.NET Core MVC app in Azure. I have implemented the logs in the MVC where I want to capure informational logs and error log. So when needed developer can view the logs in Azure portal. In order to do so, I followed some tutorial and got help from stackoverflow forum and tried different ways and multiple times but I am not able to see the error log in filesystem. My goal is the view the file for information log and error using file system. As there are many ways to view the error but I am not want to just see the error but the information as well and that I want to see in the file. Please see below images for the code and setting in Azure.
--Code to capture the error. This method call another method whichly surely thows an error. I used diagonostic jsut to try if that can capture informaiton in log file. However, I have other code that does have code for _loggger.logInformation("Information goes here")
--Turned on the FileSystem loggin in Azure after the deployment was completed.

--Kudu view for the file under home>Logfiles>Application. Beside the view, I checked for the files in other folders just incase if file was created at other location but no file was created.
So please help.



I am able to log the Information and Error messages with the same code which you have shared.
(ex.Message,"Text"), set the Error message as(ex,"Text").builder.Logging.AddApplicationInsights();line of code if you don't want to check the logs in Application Insights.My
Controller.cs:My
appsettings.jsonfile:App Service logsenable theApplication logging,Web server logging,Detailed error messagesandFailed request tracingas shown below.Execute the request from the Controller.
Now check for the logs and traces in LogStream.
Diagnostics-Logs(which I have set inProgram.csfile) will be created underC:\home\LogFiles\Applicationfolder.LogStreamcan be seen here as well.