Free NHibernate and NLog

I am having problems with some vague errors arising from my free configuration. I read that setting up a registration solution will help me with this issue. I would like to use NLog. I understand that I need to use Common.Logging 2.0 and NHibernate.IInterfaceLogger to start and run it. I just don’t know how to assemble these pieces. My system is based on bow architecture. I have a registration service configured for NLog, and I have my own interface for it, but I'm a bit confused about where I have to bundle it all together. My Fluent NHibernate configuration exists in my Data project. I guess I want to tie it all together.

Any thoughts on this would be wonderful! I'm a little lost!

+4
source share
1 answer

NHibernate.NLog nuget package does this. Now I use it in a project.

For completeness or when this package ever disappears or the user does not use nuget. You add this to your FluentConfiguration:

.ExposeConfiguration(c => { c.SetProperty(@"nhibernate-logger", @"Microfilm.Core.NLogFactory, Microfilm.Core"); }) 

ILoggerFactory to return a class that implements IInternalLogger . It’s pretty simple what to include in the IInternalLogger methods; you simply connect calls to the NHibernate registrar for NLog calls.

+6
source

All Articles