Guest AmritpalSinghNaroo Posted April 20, 2023 Posted April 20, 2023 Azure provides built-in diagnostics to assist with debugging an App Service web app. The primary aim of this blog is to guide one step-by-step to add instrumentation to your application, as well as how to access the information logged. Step 1: Go to >App Service Logs> Enable Application Logging (Blob) and select the desired Blob Storage and the Container and select the Level of logging. For more information on different types of logs you can refer this document. Step 2: Below is the code we have deployed a .Net Core MVC web application in a Windows App Service. public IActionResult Index() { _logger.LogInformation("This is a test to send logs to : Blob "); return View(); } public IActionResult Privacy() { return View(); } Below are different level of logs details which you can log: Note: If you write logs to blobs, the retention policy no longer applies if you delete the app but keep the logs in the blobs. For more information, see Costs that might accrue after resource deletion. Step 3: Go to Storage Account> Container and select the folder with your app service name and download the ( .txt ) file to check the logs. The Blob option also includes additional information in the log messages, such as the ID of the origin VM instance of the log message (InstanceId), thread ID (Tid), and a more granular timestamp (EventTickCount) in a ( .csv ) file. More information: Enable diagnostics logging - Azure App Service | Microsoft Learn azure-content/web-sites-enable-diagnostic-log.md at master · Huachao/azure-content · GitHub If you have any other questions, feel free to comment below! Continue reading... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.