Hibernating Rhinos

Zero friction databases

Use log4net version 1.2.11.0 with NHibernate Profiler

We got lots of requests to support log4net 1.2.11.0 when using the web.config or app.config to configure the profiler. We already supported log4net 1.2.11 if you initialized the profiler using code, eg NHibernateProfiler.Initialize(), by auto compiling our inner appedner against the version of log4net that your application is using. But when you initialize the profiler using config file you need an assembly that is already compiled against log4net.

We thought how we can support this, and we came up with an interesting solution.

Starting with build #2122, we let you call the following code from your application, which will generate an assembly that will be compiled against the version of log4net that your application is using, and will be saved to the location that you can specify in the parameter:

NHibernateProfiler.GenerateAssemblyForCustomVersionOfLog4Net(AppDomain.CurrentDomain.BaseDirectory);

This will create the following dll in the output folder:

HibernatingRhinos.Profiler.Appender.CustomNHibernateLog4Net.dll

Now you can use this dll in order to initialize the profiler using the configuration file.

Comments

No comments posted yet.

Comments have been closed on this topic.