you can also use plain ol' show_sql, and in your web app you'd use Console.SetOut to re-route the default Console.Out stream to whereever you like (filesystem, db, trace, whatever)
I started to answer here, but it grew too large, so I made it into a blog post: http://www.kenegozi.com/blog/2010/01/05/nhibernate-and-activerecordrsquos-showsql-in-web-application.aspx On Tue, Jan 5, 2010 at 7:50 AM, Mike Christensen <m...@kitchenpc.com> wrote: > Yup, that's what I ended up doing. I use the DebugAppender class and > now I can see all the NHibernate SQL calls in the Visual Studio output > window. Very handy! > > On Mon, Jan 4, 2010 at 9:46 PM, Ayende Rahien <aye...@ayende.com> wrote: > > That is pretty much it. > > A simple way to get some of what it does it to use log4net's debug > appender > > for NHibernate.SQL and use dbgviewer to look at it. > > > > On Tue, Jan 5, 2010 at 7:44 AM, Mike Christensen <m...@kitchenpc.com> > wrote: > >> > >> Yup, I've used it before. It's great but insanely expensive for what > >> it does. I'm curious as to how it works though, I assume it listens > >> on some NHibernate event that gets fired whenever a SQL query is run. > >> > >> On Mon, Jan 4, 2010 at 9:42 PM, Ayende Rahien <aye...@ayende.com> > wrote: > >> > Mike, > >> > Take a look at http://nhprof.com, it does exactly that. > >> > > >> > On Tue, Jan 5, 2010 at 1:56 AM, Mike Christensen <m...@kitchenpc.com> > >> > wrote: > >> >> > >> >> This should be a simple question, but what's the best and easiest way > >> >> to get a view of all SQL queries being run? I was able to turn on a > >> >> debug mode that would write queries to Console, but this no longer > >> >> works when you're writing a web app. If I could just Debug.WriteLine > >> >> each query that would be awesome. Is there like an event I can > attach > >> >> to or something? Thanks! > >> >> > >> >> Mike > >> >> > >> >> -- > >> >> > >> >> You received this message because you are subscribed to the Google > >> >> Groups > >> >> "Castle Project Users" group. > >> >> To post to this group, send email to > >> >> castle-project-us...@googlegroups.com. > >> >> To unsubscribe from this group, send email to > >> >> castle-project-users+unsubscr...@googlegroups.com<castle-project-users%2bunsubscr...@googlegroups.com> > . > >> >> For more options, visit this group at > >> >> http://groups.google.com/group/castle-project-users?hl=en. > >> >> > >> >> > >> > > >> > -- > >> > > >> > You received this message because you are subscribed to the Google > >> > Groups > >> > "Castle Project Users" group. > >> > To post to this group, send email to > >> > castle-project-us...@googlegroups.com. > >> > To unsubscribe from this group, send email to > >> > castle-project-users+unsubscr...@googlegroups.com<castle-project-users%2bunsubscr...@googlegroups.com> > . > >> > For more options, visit this group at > >> > http://groups.google.com/group/castle-project-users?hl=en. > >> > > >> > >> -- > >> > >> You received this message because you are subscribed to the Google > Groups > >> "Castle Project Users" group. > >> To post to this group, send email to > >> castle-project-us...@googlegroups.com. > >> To unsubscribe from this group, send email to > >> castle-project-users+unsubscr...@googlegroups.com<castle-project-users%2bunsubscr...@googlegroups.com> > . > >> For more options, visit this group at > >> http://groups.google.com/group/castle-project-users?hl=en. > >> > >> > > > > -- > > > > You received this message because you are subscribed to the Google Groups > > "Castle Project Users" group. > > To post to this group, send email to > castle-project-us...@googlegroups.com. > > To unsubscribe from this group, send email to > > castle-project-users+unsubscr...@googlegroups.com<castle-project-users%2bunsubscr...@googlegroups.com> > . > > For more options, visit this group at > > http://groups.google.com/group/castle-project-users?hl=en. > > > > -- > > You received this message because you are subscribed to the Google Groups > "Castle Project Users" group. > To post to this group, send email to castle-project-users@googlegroups.com > . > To unsubscribe from this group, send email to > castle-project-users+unsubscr...@googlegroups.com<castle-project-users%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/castle-project-users?hl=en. > > > -- Ken Egozi. http://www.kenegozi.com/blog http://www.delver.com http://www.musicglue.com http://www.castleproject.org http://www.idcc.co.il - הכנס הקהילתי הראשון למפתחי דוטנט - בואו בהמוניכם -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to castle-project-us...@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.