简体   繁体   中英

EF errors logging in log4net

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM