Search This Blog

Thursday, September 13, 2012

log4net nhibernate stop logging to console

After using log4net and nhibernate in one project I wanted to log sql commands in a separate file. I didn't want these sql commands to appear on console either. My castle implementation of nhibernate logged either all to console and separate file or nothing.
That's the configuration I used to stop nhibenrate from logging to console and force it to log to a separate file:

download

The important part is to use a filter inside a ConsoleAppender:


<filter type="log4net.Filter.LoggerMatchFilter">
<LoggerToMatch value="NHibernate"/>
<acceptOnMatch value="false"/>
</filter>

1 comment:

  1. z3o73z3h55 e9l41i3u60 u6s90e8i22 z6u60b4x55 http://www.dolabuy.ru/wallets-c-157_158_201/louis-vuitton-m80151m80152-cl%C3%A9a-wallet-monogram-empreinte-leather-p-3236.html>g5i41w6x46 b4j58l4g13

    ReplyDelete

If you like this post, please leave a comment :)