Reputation: 45
I have a cloud service which have web role and worker role. I need to implement logging using log4net but I am facing the issue which is that it Azure cloud service VM refresh after the maintenance and all the physical files which were created at that time are deleted. My question is how can we preserved those physical files?
Upvotes: 1
Views: 186
Reputation: 7025
You can't. The correct solution is using a different storage, the best one is Blob Storage, as Blobs is the solution from Azure to provide storage online.
Here is an appender of log4net to store logs in Blobs.
EDIT: Check this SO question for more details. This blog article can help too.
Upvotes: 1
Reputation: 4062
Which files do you want to preserve? Logs? In case of Cloud Services, you have stateless model, and that is why you there is such mechanism as a Azure Diagnostics and you can use log4net on top of that if you want (but you can use Azure Diagnostics without that, and that is convenient for logging). There are a lot of manuals about how to setup the log4net on top of Azure Diag, i.e., http://raol.github.io/2015/02/17/logging-with-log4net-in-azure/ Hope that helps - if not, please feel free to ask.
Upvotes: 1