I just started plugging in Log4Net into our application and am looking to log problems that occur accessing the DAL (e.g. anything from invalid SQL syntax to broken connections, query timeouts), etc.
Any thoughts on where the best place to inspect and log such exceptions would be? I'm fine with doing this on the server side of the data portal, so DataPortal_OnDataPortalException() looked promising.
In this case I'm mainly looking for exceptions thrown by my DAL, so I think DataPortal_OnDataPortalException() will do the trick. It's nice to know that you could (at least in theory) log all of your data portal calls by hooking the pre/post methods.
Thanks!
You might want to put the logging code in there anyway.
Keep in mind that log4net has various levels of logging –
down to the info level. So you could do info logging in all the methods, and
error logging in the ODPE() method. Normally the info logging would be turned
off, but if you needed a detailed trace you could turn it on by changing the
log4net config in the config file.
Just something to consider.
Rocky
Copyright (c) Marimer LLC