Why not try using log4net and turn on the "sql logging" attribute.
Here is one example: Might be too bit verbose, but might satisfy your need. http://davesquared.blogspot.com/2008/01/viewing-sql-generated-by-nhibernate.html Jerry Porter ----- Original Message ---- From: gatapia <[EMAIL PROTECTED]> To: nhusers <[email protected]> Sent: Wednesday, November 19, 2008 8:34:15 PM Subject: [nhusers] Intercepting hits to the database Hi All, I was just wondering if I can intercept hits to the database? Basically I want to log how many times an asp.net request hits the database. I had a quick look at the source code and it looks like Batcher.LogCommand does exactly what I want but it is not intercepteable (no hooks). I've also looked at IInterceptor but I think this is at a higher level and does not differentiate between cache hits and DB hits. I really just want to listen to queries not updates/inserts/deletes as these are not really optimiseable in this application. Any help is appreciated. Thanks Guido Tapia --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
