2
votes

I have created a java MVC web app and deployed on the Azure cloud. Now I am trying to capture my web application logs into the text/CSV file and store that text/CSV file in Azure Blob Storage. Can anyone tell me how to do this? How to access Azure Blob Storage. I went through this article but was not of much help.

Please anyone help.

Note- In on premises application we can do the same using properties file & log4j jar.

I want to do the same in Azure web App.

2
do you use Azure Cloud Service WebRole? or Azure App Service (aka Azure Websites)?Xiaomin Wu
I am using Azure App ServiceNidhee

2 Answers

0
votes

You need to download the azure-storage-java and then you can just follow the article you mentioned: storage-java-how-to-use-blob-storage. If you have any problems in the article, you need to show the code sample that gives you the problem.

0
votes

Based on my understanding, I think the simple way to satisfy your needs is using a log4j appender for storing the logs into Azure Blob Storage. It only need to change the log4j.properties file to enable the appender for Azure.

There are two unoffical project on GitHub for implementing log4j appender for Azure Table Storage, not for Blob Storage.

They are as below.

  1. saksham/log4j-azure: https://github.com/saksham/log4j-azure
  2. JMayrbaeurl/azure-log4j: https://github.com/JMayrbaeurl/azure-log4j

You can try to refer to these codes to implement your appender for Blob Storage, such as Append Blobs.

But I think using Azure Table Storage is the simplest way for logging, exactly as the authors thought.