Implement nhibernate ILoggerFactory and IInternalLogger.. and deliver as
nuget package, class only

The package will depend on *nlog *and *nhibernate *packages.

I did this for NHibernate.SetForNet4... it is a one-class package that
allows me to use ISet/HashSet from .Net4.

You can actually use the code and structure of my package:
https://bitbucket.org/jfromaniello/nhibernate.setfornet4/src

this is the directory you might be interested on:
https://bitbucket.org/jfromaniello/nhibernate.setfornet4/src/7f68cf01a076/NHibernate.SetForNet4/

Just download it, add your classes, remove mines... modify the xml rebuild
and upload the package to nuget.org
I am looking forward to this.


2011/5/3 Ilia Ternovich <[email protected]>

> Ok. I see your point, thanks anyway
>
> 2011/5/4 Fabio Maulo <[email protected]>:
> > No.
> > I mean that you can do the same in your code.
> >
> > On Tue, May 3, 2011 at 5:47 PM, Ilia Ternovich <[email protected]>
> wrote:
> >>
> >> Thanks Fabio!
> >>
> >> Before writing to nhusers I've carefully reviewed how NHibernate works
> >> with log4net without referencing it (thats where I've found
> >> nhibernate-logger hardcoded config section key inside code).
> >>
> >> Do you mean that we can extend following code in Loggins.cs:
> >>                                var log4NetDllPath =
> Path.Combine(binPath,
> >> "log4net.dll");
> >>
> >>                                if (File.Exists(log4NetDllPath))
> >>                                {
> >>                                        nhibernateLoggerClass = typeof
> >> (Log4NetLoggerFactory).AssemblyQualifiedName;
> >>                                }
> >>
> >> and add something like:
> >>
> >>  var nlogNetDllPath = ...
> >>  if ( File.Exists(nlogNetDllPath) )
> >>  // create NLogNetLoggerFactory which works like Log4NetLoggerFactory
> >> using reflection and delegates
> >>
> >> If so I can easily write NLogNetLoggerFactory the way
> >> Log4NetLoggerFactory is working now.
> >>
> >> 2011/5/4 Fabio Maulo <[email protected]>:
> >> > Again...
> >> > The code Ilia, the code. Share the code instead a DLL.
> >> > In your opinion which is the sense of adding a DLL just for less than
> >> > 100
> >> > lines ?
> >> > Who will update that DLL each time NLog release a new version or NH
> >> > release
> >> > a new version ?
> >> > Share the code, that is all.
> >> >
> >> > On Tue, May 3, 2011 at 5:22 PM, Ilia Ternovich <[email protected]>
> >> > wrote:
> >> >>
> >> >> Thanks Fabio, but http://nhlogging.codeplex.com/ is referenced
> against
> >> >> NHibernate 3.0 and not working with current release... I've mentioned
> >> >> it in previous mail
> >> >>
> >> >>
> >> >> 2011/5/4 Fabio Maulo <[email protected]>:
> >> >> > You can have and use your custom logger even redoing it
> >> >> >
> >> >> >
> >> >> >
> http://nhforge.org/wikis/howtonh/using-nlog-via-common-logging-with-nhibernate.aspx
> >> >> > That does not mean that we want a new DLL to deploy.
> >> >> > If you look inside NHibernate you can find how we are creating
> >> >> > a ILoggerFactory and a IInternalLogger on the fly for Log4Net
> without
> >> >> > have a
> >> >> > dependency to Log4Net.
> >> >> > You can do the same for NLog o for CommonLogging
> >> >> > (http://netcommon.sourceforge.net/).
> >> >> > On Tue, May 3, 2011 at 5:11 PM, tillias <[email protected]>
> wrote:
> >> >> >>
> >> >> >> Why?
> >> >> >>
> >> >> >> Does it means that you don't want custom logging used for
> >> >> >> NHibernate?
> >> >> >> Or there is another way to use NLog or Enterprise Logging with
> >> >> >> NHibernate?
> >> >> >>
> >> >> >> On 4 май, 00:08, Fabio Maulo <[email protected]> wrote:
> >> >> >> > No.
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> > On Tue, May 3, 2011 at 5:04 PM, tillias <[email protected]>
> >> >> >> > wrote:
> >> >> >> > > Hello! I've created logging bridge today for NHibernate and
> NLog
> >> >> >> > > by
> >> >> >> > > providing custom implementations of ILoggerFactory and
> >> >> >> > > IInternalLogger. Here are the description and some arch
> >> >> >> > > problems:
> >> >> >> > >http://tillias.wordpress.com/2011/05/03/nhibernate-and-nlog/
> >> >> >> >
> >> >> >> > > Everything works fine except that ILoggerFactory and
> >> >> >> > > IInternalLogger
> >> >> >> > > are defined in NHibernate.dll assembly. In fact this means
> that
> >> >> >> > > custom
> >> >> >> > > logging providers should be rebuild each time new version of
> >> >> >> > > NHibernate is released (new assembly).
> >> >> >> >
> >> >> >> > > Is it possible to extract ILoggerFactory and IInternalLogger
> >> >> >> > > into
> >> >> >> > > separate assembly? Thanks!
> >> >> >> >
> >> >> >> > > --
> >> >> >> > > You received this message because you are subscribed to the
> >> >> >> > > Google
> >> >> >> > > Groups
> >> >> >> > > "nhusers" group.
> >> >> >> > > To post to this group, send email to [email protected]
> .
> >> >> >> > > To unsubscribe from this group, send email to
> >> >> >> > > [email protected].
> >> >> >> > > For more options, visit this group at
> >> >> >> > >http://groups.google.com/group/nhusers?hl=en.
> >> >> >> >
> >> >> >> > --
> >> >> >> > Fabio Maulo
> >> >> >>
> >> >> >> --
> >> >> >> You received this message because you are subscribed to the Google
> >> >> >> Groups
> >> >> >> "nhusers" group.
> >> >> >> To post to this group, send email to [email protected].
> >> >> >> To unsubscribe from this group, send email to
> >> >> >> [email protected].
> >> >> >> For more options, visit this group at
> >> >> >> http://groups.google.com/group/nhusers?hl=en.
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Fabio Maulo
> >> >> >
> >> >> > --
> >> >> > You received this message because you are subscribed to the Google
> >> >> > Groups
> >> >> > "nhusers" group.
> >> >> > To post to this group, send email to [email protected].
> >> >> > To unsubscribe from this group, send email to
> >> >> > [email protected].
> >> >> > For more options, visit this group at
> >> >> > http://groups.google.com/group/nhusers?hl=en.
> >> >> >
> >> >>
> >> >> --
> >> >> You received this message because you are subscribed to the Google
> >> >> Groups
> >> >> "nhusers" group.
> >> >> To post to this group, send email to [email protected].
> >> >> To unsubscribe from this group, send email to
> >> >> [email protected].
> >> >> For more options, visit this group at
> >> >> http://groups.google.com/group/nhusers?hl=en.
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Fabio Maulo
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "nhusers" group.
> >> > To post to this group, send email to [email protected].
> >> > To unsubscribe from this group, send email to
> >> > [email protected].
> >> > For more options, visit this group at
> >> > http://groups.google.com/group/nhusers?hl=en.
> >> >
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "nhusers" group.
> >> To post to this group, send email to [email protected].
> >> To unsubscribe from this group, send email to
> >> [email protected].
> >> For more options, visit this group at
> >> http://groups.google.com/group/nhusers?hl=en.
> >>
> >
> >
> >
> > --
> > Fabio Maulo
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "nhusers" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> > http://groups.google.com/group/nhusers?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to