In previous post I showed how to create a publish/subscribe logger with WCF and log4net, now I show you my first use of this particular appender.
When you work with nhibernate you can use show-sql configuration parameter to instruct nhibernate to show generated sql, but how can you see this output in a running windows application? You should know that NHibernate has various log4Net logger, and you can instruct the session to dump all sql code to a logger, here it is a possible configuration
With this configuration I instruct NHibernate to log to WCFAppender all generated SQL. Now I can attach a log viewer to a running application and look in real time to the sql instruction that nhibernate generates. You can attach more than one application, whenever you want.
Welcome to log4net live logging monitor :D