Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8019713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:28:28+00:00 2026-06-04T21:28:28+00:00

This is driving me crazy… I’ve spent half a day trying to turn everything

  • 0

This is driving me crazy… I’ve spent half a day trying to turn everything aroung but I can’t get log4net to spit out anything about NHibernate.

Here’s my current Fluent NHibernate config:

var configuration = Fluently.Configure()
    .Database(SQLiteConfiguration.Standard.UsingFile(AppConstants.PATH_FILENAME_DB))
    .Mappings(m => m.FluentMappings.AddFromAssemblyOf<...>())
    [...Mappings...]
    .Diagnostics(x => x.Enable());

My app.config:

<configSections>
  <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>

<log4net>
  <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
    <param name="File" value="data/log/unprocessed.log"/>
    <param name="AppendToFile" value="true"/>
    <layout type="log4net.Layout.PatternLayout">
      <param name="ConversionPattern" value="%d [%t] %-5p %c %m%n"/>
    </layout>
  </appender>

  <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
    <layout type="log4net.Layout.PatternLayout">
      <param name="ConversionPattern" value="%d [%t] %-5p %c %m%n"/>
    </layout>
  </appender>

  <logger name="NHibernate.SQL" additivity="false">
    <level value="ALL"/>
    <appender-ref ref="LogFileAppender"/>
  </logger>

  <root>
    <level value="INFO"/>
    <appender-ref ref="LogFileAppender"/>
  </root>
</log4net>

I can log stuff right after I initialize the main form:

log4net.Config.XmlConfigurator.Configure();
logger.Info("Here is a debug log!!");

And it works 100%. However I’m not able to get anything out of Nhibernate.

I’ve tried:

  • setting ShowSql() in my Fluent NHibernate config => SQL appears in VS console.
  • adding NHibernate logger
  • removing additivity
  • using ConsoleAppender instead of LogFileAppender (still no SQL in the output though I get regular logs from the application)
  • recompiling Fluent NHibernate, tried 3 different versions of log4net…

My Fluent Nhibernate mappings are good, my app is working perfectly without log4net.

I still am unable to log any queries from NHibernate… Not sure what is going on but if you have a clue I’ll be happy to try it out!!!

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:28:29+00:00Added an answer on June 4, 2026 at 9:28 pm

    Well I ended up finding the issue…

    All my DLLs were located in /lib folder instead of the output folder.

    Part of my app.config had this:

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
    <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <probing privatePath="lib"/>
        <dependentAssembly>
          <assemblyIdentity name="System.Data" publicKeyToken="b77a5c561934e089"/>
          <bindingRedirect oldVersion="2.0.0.0" newVersion="4.0.0.0"/>
        </dependentAssembly>
      </assemblyBinding>
    </runtime>
    

    Putting log4net.dll in my output folder fixed the issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is driving me crazy. I'm trying to get the footer div to be
I'm sure I'm doing something silly, but this is driving me crazy. I'm trying
This is driving me crazy, at the moment I can't get what seems a
This is driving me crazy and I can't find the answer anywhere. I have
This is driving me crazy, I am trying to do something like: $this->data =
This is driving me crazy, I just can't find out the problem: I have
ok this is driving me crazy. I have been trying to parse a xml
Sorry for the stupid question, but this is driving me crazy... I have test_framework.php
Please apologize for the basicness of my question, but this is driving me crazy
This is driving me crazy. Is there someone out there that can help? Traceback

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.