views:

24

answers:

1

I am trying to capture Entity Framework errors in log4net. Has anyone successfully done that? Any suggestions?

+1  A: 

Your question is a bit scarce on information, and isn't specific enough to provide a meaningful answer. Also, I don't have any experience using Entity Framework.

That said, using log4net with Entity Framework should be no different than using it with any other .Net based framework or programming methodology. There are many online resources (like the log4net homepage!) which show you how to set it up for many different scenarios.

With regards to EF, you just need to determine where your error logging points should be (which is a debate for a different day), and then just add the log4net error-logging code at those points.

Saajid Ismail