José F. Romaniello

Las aventuras y desventuras de un codificador.

I have created a new package that add support for writing NHibernate logs with NLog.
The package is not a dll but only one class.

In order to use this package, simply install with nuget:


This is an example app.config file:

<?xml version="1.0" encoding="utf-8" ?>
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
    <add key="nhibernate-logger" value="YourNamespace.NLogFactory, YourAssemblyName"/>

  <nlog xmlns="" xmlns:xsi="">
      <target name="ds" xsi:type="Console"/>
      <logger name="NHibernate.SQL" minlevel="Debug" writeTo="ds" />

Remember to change “YourNamespace” and “YourAssemblyName”. That is all.
You don’t need to run Configure or some initialization code as in log4net.

There is an alternative approach here but it is a little bit more complicated.

| More

1 comentarios:

Hello Jose!

Ping back from

I've managed to remove direct reference to NLog there. Can you please update Nuget package please?

Publicar un comentario en la entrada