1

Currently in my project, I am logging exceptions by using elmah in a separate table in SQL Server. Is it possible to store these elmah exceptions in Azure storage only, not in SQL Server? Since I do not want to log errors in my database.

//web.config     
<elmah>
    <security allowRemoteAccess="1" />
    <errorLog type="Elmah.SqlErrorLog, Elmah" 
              connectionStringName="DatabaseConnectionStringName" />
</elmah>    

Currently in my web.config, I configure for elmah logs in SQL Server.

Set allowRemoteAccess = 1 and added errorlog type as Elmah.SqlErrorLog. Can anyone help?

Thanks in advance.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Nascent
  • 48
  • 8

1 Answers1

1

It is possible, we can store elmah exceptions in Azure table storage.

We need to use this package: Elmah.AzureTableStorage.

We can install this via VS Package Manager:Install-Package Elmah.AzureTableStorage -Version 1.0.0.

In web.config, we can set as below:

<errorLog type="Elmah.AzureTableStorage.AzureTableStorageErrorLog, Elmah.AzureTableStorage"
connectionStringName="ElmahAzureTableStorage" />

I have tested and the screenshot of my log in table storage for your reference:

enter image description here

More information for your reference:

GitHub: Elmah.AzureTableStorage

ELMAH on Azure Table Storage

Lee Liu
  • 1,981
  • 1
  • 12
  • 13