SamJolly
SamJolly

Reputation: 6477

Elmah, what is the most efficient persistent mechanism for errors?

I have an asp.net MVC application in Azure web apps which connects to SQL Azure.

Currently I store Elmah errors in App_data. These can build up. Also I feel writing these files is inefficient. In addition when you download the "Next 50" errors, there can be a hit on the server.

How can I improve my persistence strategy? I suspect it may be to use a database. Would this be a seperate database to the application database or the same one?

I am also testing Application Insights. At present I suspect that Elmah has a role alongside Application Insights, but I might be wrong.

Thanks.

Upvotes: 0

Views: 420

Answers (2)

Aravind
Aravind

Reputation: 4163

As mentioned in the previous answer you can store the log files in a sql azure database . or you can go with a cheaper option of azure table storage which is a no-sql based data store. There is a provider available for the same. https://github.com/MisinformedDNA/Elmah.AzureTableStorage https://www.nuget.org/packages/WindowsAzure.ELMAH.Tables/ or if you looking more at a data dump of your logs say in xml format and does not really need a queryable format you can opt for a much cheaper azure blob storage . https://github.com/dampee/Blob-Elmah

Upvotes: 1

Thibaut Ranise
Thibaut Ranise

Reputation: 715

An Elmah database can be used in a separate Azure DB to not consume your "Business" database DTUs and by the way never affect it's performance if you want to log a lot of things.

On the one hand Elmah can take care of "Functionnal" logs, on the other and application Insight can do telemery and monitoring logs, besides you can enable server and applications logs in the Azure Portal to get automatic logs in a storage account, here is an overview of those server and application logs.

Upvotes: 1

Related Questions