We are trying to integrate NHibernate as our OR/M, however, we are currently using Enterprise Library’s logging application block. I know that NHibernate uses log4net to log. Does anyone have any example on how to use Enterprise Library to log NHibernate related logs?
We are trying to integrate NHibernate as our OR/M, however, we are currently using
Share
Write your own log4net appender that writes to a EL logger. It’s an adapter pattern.
inherit a new/custom appender class from
log4net.Appender.AppenderSkeletonoverride the
Appendevent handler from the skeleton class, and in it show theRenderedMessage, something like this:you then need to configure log4net config file….
I have not tested this, but it should get you going.