views:

181

answers:

2

I'm developing a win app in C# which communicates to a WCF Service. I want to log exceptions that are thrown on client to be logged in Sql Lite Database (Win app is using Sql Lite database for storing data locally). And then later it should be sent to the wcf service when required so that it can be useful for support/analysis/application improvement.

I want a method which can be directly called in every catch block simply by LogHelper.Log(ex).

I would like to know if anyone has done it through Enterprise library or used any good practice for such situation?

Update I'm already using sql lite database for storing data locally through System.Data.SqLite library

A: 

You cannot directly use microsoft enterprise library with sqlite database as backend. Use System.Data.SQLite library for all database operations.

If you still want to use enterprise library check this article. Anyways you will have to install the System.Data.SQLite library. As per my experience System.Data.SQLite will be enough for all database operations.

One more word of caution, sqlite does not support concurrency. So any database operation will lock the entire datase for the duration.

Aseem Gautam
I'm already using sql lite database for storing data locally through System.Data.SqLite library.
Ismail
+2  A: 

I've written a number of blog posts on this recently. I'm sure one or the other will provide the answer that you need:

Thomas Beck
Sorry, didn't see that you were looking at EL. My posts address this challenge specifically with NLog. I too use EL when clients require it - never done it with SQLite. If you have a choice, I'd recommend you give NLog a look.
Thomas Beck
Thanks Thomas, I'm looking into it. Seems that I can use it.
Ismail
It would have been great if you can post the source code on your blog. Source code is always helpful.[Jokingly] Do you know that developers read and understand code faster than English? :D
Ismail