nLog with Entity Framework 4.0

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

nLog with Entity Framework 4.0

rakesh
I want to log DML operation on database tables through Entity Framework. Is this possible using nLog? If yes then can anyone provide sample/tutorial for that. Pls help.
Reply | Threaded
Open this post in threaded view
|

Re: nLog with Entity Framework 4.0

Jarek Kowalski
Administrator
Check out this blob post:

http://blogs.msdn.com/b/jkowalski/archive/2009/06/11/tracing-and-caching-in-entity-framework-available-on-msdn-code-gallery.aspx

It explains a way to intercept DML statements generated by EF by using EFTracingProvider. There are events you can hook up to emit log statements before/after SQL queries are executed.

NLog Blog