how to use log4Net adonetappender to store the data in to azure table stroage

604 Views Asked by At

We are using log4Net Adonetappender to store the audit log data from our app using configuration in to sqlserver table, now we are moving our app to Windows Azure, now we want to use the same adonetappender to store the data in to Windows azure table storage instead of sql azure database due to cost expensive of sql azure storage. If we want to store in to the sql azure no need any modifications our app is working fine with out any isues, but we want to store this audit log data in to windows azure table storage as this data grows rapidly and azure table storage is used for high scalability and less cost compare to sql azure.

2

There are 2 best solutions below

0
On

I don't believe that approach will work. Azure Tables do not have an ADO.NET interface. If you want to write directly out of log4net, you'll most likely have to write your own adapter to do it.

That said, Azure Diagnostics writes to Table Storage already. If you set up Azure Diagnostics as they tell you to, and set up a log4net TraceAppender, then the log messages will go into Table Storage. It's a bit roundabout, but I actually use that myself.

0
On

I just had this same problem, and found my answer in this thread: log4net ADO.NET Appender works on Dev Fabric, but fails silently on Azure

Short version: adonetappender works fine in Azure, but you need to make sure your table has a clustered index on it. See if you can manually insert a row into your log table on Azure to confirm that's the issue.