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.
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.
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.
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.