Jump to content

Storing App Service application logs in Blob


Recommended Posts

Guest AmritpalSinghNaroo
Posted

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.

 

 

 

mediumvv2px400.png.d006d182c2a3bfc2cf716ae92a74d140.png

 

 

 

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:

 

 

 

399x255vv2.png.6586f9854ce98c1753af0a1a39f2dcff.png

 

 

 


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.

 

 

 

421x90vv2.png.688ced34e72a5d8ceadc68efcb969b40.png

 

 

 

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:

 

 

 

 

If you have any other questions, feel free to comment below!

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...